简体   繁体   English

如何在Linux服务器中找到正在运行的应用程序的JRE版本

[英]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: 这可能取决于许多因素:

  • If the launcher uses an absolute path for the java command, then that is what will use. 如果启动器为java命令使用绝对路径,则将使用该路径。
  • If the launcher uses a simple name (eg 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.

相关问题 如何打印或获取服务器上运行的应用程序的JRE版本? - How to print or get JRE version of an application running on a server? 如何将 jre8 与 springboot 应用程序捆绑在一起,以在安装了先前 Java 版本的服务器上运行它? - How can I bundle jre8 with springboot application to run it on server which has previous java version installed? 我有一个Java应用程序在JRE 6中运行,但不在JRE 7中运行。如何在JRE7中运行该应用程序 - I have a Java App running in JRE 6 but not in JRE 7. How do i run the application in JRE7 在哪里可以找到特定版本的IBM JDK / JRE for Windows? - Where can I find a particular version of the IBM JDK/JRE for Windows? 如何控制与应用程序捆绑在一起的JRE版本? - How do I control what JRE version is bundled with my application? 如何在Eclipse项目中更改JRE版本? - How can I change JRE version in Eclipse project? 如何更改本地Linux服务器上的Java版本 - How can I change java version on local linux server 如何使用java应用程序检查jre版本 - how to check jre version using java application 如何将特定的JRE版本设置为在JBoss上运行的Java应用程序的默认版本 - How to set a particular JRE version as default for my Java application running on JBoss 如何找到 OpenJDK 的 JRE 包? - How can I find OpenJDK's JRE package?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM