检查运行时使用的JRE版本 [英] Checking the version of JRE used during run-time

查看:135
本文介绍了检查运行时使用的JRE版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的系统上安装了多个版本的jre。有什么办法可以让我知道应用程序在运行时使用了哪个JRE版本。

I have multiple version of jre's installed on my system. Is there any way i would know which JRE version is being used by the application during run time.

申请可能会使用较低版本的JRE - 不确定

There might be possible that application may use lower version of JRE -"Not Sure"

先谢谢。

推荐答案

使用

System.getProperty("java.version")

将返回当前运行的JVM的版本。

will return the version of the currently running JVM.

有时候这不会返回任何东西(不知道为什么)。在这种情况下,您可以尝试:

Sometimes this does not return anything (don't know why). In that case you can try:

System.getProperty("java.runtime.version");

这篇关于检查运行时使用的JRE版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆