5

I mean using javacode I want to find the JRE version of application but not server. In my production server I am having thousands of applications in java like tomcat,websphere,axway etc. I want to know particular application jre version.I will write a class and I want print using that. That class will be placed in particular application.

I tried this link but I didn't get it.

Community
  • 1
  • 1
sunleo
  • 10,589
  • 35
  • 116
  • 196
  • This answer is what you're looking for I think: http://stackoverflow.com/a/222868/180100 –  Dec 18 '12 at 15:39
  • http://stackoverflow.com/a/222868/57695 from the question you linked to. What do you mean by "I didn't get it"? – Peter Lawrey Dec 18 '12 at 15:40
  • @RC. no that prints JRE version of main server(rd-hat).Which has many servers tomcat4,5,6 if I run a application in tomcat 4, its related jre versi0n should be printed. – sunleo Dec 18 '12 at 15:42

1 Answers1

8

You should try System.out.println(System.getProperty("java.version")); I have successfully tested that it prints the actual version of Java that is used to run the code.

dotvav
  • 2,808
  • 15
  • 31