[英]how can I find JRE version of running application in Linux server
I am getting below result, Does it mean I am having JDK 1.7.0_45 and JRE is 1.42 ? 我得到的结果不足,是否表示我拥有JDK 1.7.0_45且JRE为1.42? Please advise. 请指教。
$ javac -version
Eclipse Java Compiler v_677_R32x, 3.2.1 release, Copyright IBM Corp 2000, 2006. All rights reserved.
$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
$ alternatives --config java
There is 1 program that provides 'java'.
Selection Command
-----------------------------------------------
*+ 1 **/usr/lib/jvm/jre-1.4.2-gcj/bin/java**
Enter to keep the current selection[+], or type selection number:
It would appear that you have two versions of Java installed: 看来您已经安装了两个版本的Java:
The Java on your PATH is Java 1.7.0. PATH上的Java是Java 1.7.0。 I think it is an Oracle build rather than a build from your Linux system's package repository. 我认为这是Oracle构建,而不是Linux系统软件包存储库中的构建。
The Java configured using alternatives
looks like a GCJ Java that is compatible with Java 1.4.2. 使用alternatives
配置的Java看起来像是与Java 1.4.2兼容的GCJ Java。 It was probably installed from your package repository. 它可能是从软件包存储库安装的。 IMO, it is inadvisable to use this from a technical standpoint. IMO,从技术角度考虑,不建议使用此功能。 In fact, I would recommend uninstalling it. 实际上,我建议您将其卸载。
Actually I am getting "Unsupported major.minor version 51.0" error after uploading a external jar file to Informatica powercenter Java transformation. 实际上,在将外部jar文件上载到Informatica powercenter Java转换后,出现“ Unsupported major.minor version 51.0”错误。
That implies that Informatica is using the Java 1.4.2 installation. 这意味着Informatica正在使用Java 1.4.2安装。
Now, the version of Java that an application uses will depend on what version of Java the application's launcher / launch script is using. 现在,应用程序使用的Java版本将取决于应用程序的启动器/启动脚本使用的Java版本。 That could depend on a number of things: 这可能取决于许多因素:
java
command, then that is what will use. 如果启动器为java
命令使用绝对路径,则将使用该路径。 java
) then the version used will depend on the launcher's $PATH
. 如果启动器使用简单名称(例如java
),则使用的版本将取决于启动器的$PATH
。 This is probably what is happening ... and the $PATH
used is different from your shell's $PATH
. 这可能是正在发生的事情...并且所使用的$PATH
与shell的$PATH
。 So what is the solution? 那么解决方案是什么?
You could add the Oracle Java install to the alternatives
system. 您可以将Oracle Java安装添加到alternatives
系统。 See man alternatives
or Google for instructions using "java oracle alternatives install" 请参阅man alternatives
或Google,以获取有关使用“ java oracle替代品安装”的说明。
You could tweak the $PATH used by the application's launcher. 您可以调整应用程序启动器使用的$ PATH。
Depending on your Linux distro, you could install an OpenJDK 1.7.0 JDK or JRE from the package repos. 根据您的Linux发行版,您可以从软件包存储库中安装OpenJDK 1.7.0 JDK或JRE。 That will (should) add the new installed Java to the alternatives
database, so that you can select it instead of the old GCJ 1.4.2 installation. 这将(应该)将新安装的Java添加到alternatives
数据库,以便您可以选择它而不是旧的GCJ 1.4.2安装。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.