Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

which java version does tomcat use

Tags:

java

tomcat

I have set the JAVA_HOME to C:\Program Files\Java\jdk1.5.0_11
I have set the Classpath to C:\Program Files\Java\jre1.5.0_11

I have set the path to

C:\Ruby193\bin;C:\XEClient\bin; F:\oracle\product\10.2.0\db_2\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem; C:\Program Files\Java\jdk1.6.0_17\bin; C:\Program Files\jEdit;C:\Program Files\TortoiseSVN\bin; C:\Program Files\Microsoft SQL Server\90\Tools\binn\

Now my question is, what version of java does the tomcat run on?
The tomcat console writes the whole 'path'
and the cmd says it is java version 7 currently running in the system.
Someone please help me out.. I have java 5,6,7 versions installed in my system and also tomcat 5,6,7.
Now what is the tomcat's java version and the system's java version???

like image 782
Freakyuser Avatar asked Nov 08 '12 10:11

Freakyuser


People also ask

Which version of Java does Tomcat use?

Apache Tomcat requires 64-bit Java/OpenJDK.

What version of Java does Tomcat 8.5 use?

Tomcat 8.5 was designed to run on Java 7 or later.

What version of Java does Tomcat 9 use?

Apache Tomcat 9.0. x requires Java 8 or later.

Which Tomcat works with Java 11?

Java 11 Runtime for Web App (Tomcat 8)


2 Answers

You can look up the Java version Tomcat is really running with in the manager app, which is installed by default. Go to http://hostname:8080/manager/html (replace hostname by hostname or localhost), scroll to the bottom, there you will find "JVM Version".

Which JVM is selected depends a lot on the OS and way to install, maybe http://tomcat.apache.org/tomcat-7.0-doc/setup.html will help.

E.g. if you are running Windows with Tomcat with the service wrapper (I would recommend this for Windows), you can set the path to the JVM directly in the tray icon -> Configure Tomcat. In the Java tab e.g. set Java Virtual Machine to "D:\java\jdk1.6.0_35\jre\bin\server\jvm.dll" (disabled "use default") or where your JVM resides -> you need to specify the complete path to the jvm.dll.

Regarding getting to know which Java the system is running on: That's difficult to answer, there isn't really one Java version that the system is running as such. E.g. for Windows there may be one Java version set in the PATH, a potentially different one in JAVA_HOME / JRE_HOME / ..., one (or more) set in the registry, a certain version plugin active in each web browser used for applets etc. You have to check in the part you are interested in. Most good Java apps will display the version used somewhere, in logs, about dialogs or so. For Firefox you can check in the add-ons / plug-ins list. A Java exe wrapper like JSmooth can search for Java in different places and choose the most suitable, e.g. the newest, not necessarily the most "exposed".

like image 58
FelixD Avatar answered Sep 22 '22 16:09

FelixD


If you don't have the manager application on your server (I didn't), then you can check it like this:

ps -ef | grep tomcat

The output should list your running server:

tomcat     741     1 87 01:07 ?        00:01:15 /usr/java/default/bin/../bin/java ...

Now you know where your java is that your tomcat was executed from you can check the version like:

/usr/java/default/bin/../bin/java -version
like image 39
Ring Avatar answered Sep 22 '22 16:09

Ring