Re: Which Java is being used. (125 Views)
Reply
Frequent Advisor
vijay alur alur
Posts: 64
Registered: ‎03-15-2009
Message 1 of 2 (137 Views)

Which Java is being used.

Hello Alll,

 

We have Red hat Linux servers running SAP application. We have IBM and SUN java installed in it. Going further we will be installing SAP java. I am not sure which java is being used of the IBM and SUN.

 

How can i find which Java is being used i.e. IBM or SUN? Any specific command i can use?

 

 

Thanks

VJ

Lead Engineer, IMS.
iGATE
Honored Contributor
Matti_Kurkela
Posts: 6,271
Registered: ‎12-02-2001
Message 2 of 2 (125 Views)

Re: Which Java is being used.

First, you will need to determine the command and/or environment settings used when starting the Java application.

 

If the application is started with a script, you will need to check the script: there might be lines that set JAVA_HOME and/or PATH environment variables to point to a particular version of Java.

 

If the Java version is not determined explicitly at the application start-up script, you will need to look at the environment of the user that normally runs the application. The login scripts for that user might include JAVA_HOME and/or PATH settings that determine which version of Java will be used by default by that user.

 

If there are no application-specific nor user-specific settings, then you might use "which java" to see the pathname of the default Java interpreter (if there is a default Java interpreter).

 

Also, "java -version" might be useful to identify the manufacturer of a particular instance of Java.

 

If you see a "java" process in the process listing and want to know which version of Java it uses, make note of the PID of the process, then run "ls -l /proc/<PID>/exe". That will tell you the exact pathname of the java binary it uses.

 

Through the proc filesystem you can also take a peek at the environment variables of any running process, with a command like "strings /proc/<PID>/environ | less".

MK
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.