• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Getting Version Numbers

 
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All


I need to read the Version number of the Java, MySQL which the application is using is their any other way then reading registry.

so that should work in Linux also.

If you have any idea please help me

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
System.getProperty("java.version") will give you the JRE version. Is that what you are looking for or did I misunderstand the question?
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ya this what i want.. Thanks.

Can we use same for the MySql?
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
i tried
System.out.println(System.getProperty(("java.version") );
but it gives out null.

I am using window xp and jdk 1.6. follow steps to get version no :

1) in command prompt go to jdk 1.6 installation directory : example
c:\program files\java\jdk1.6.0_03>

2) type javac -version
c:\program files\java\jdk1.6.0_03>javac -version

it outputs : javac 1.6.0_03

3) or type java -version
c:\program files\java\jdk1.6.0_03>java -version

it outputs : java version "1.6.0_03"
java(TM) SE Runtime environment (build 1.6.0_03-b05)
java hotspot (tm) client VM (build 1.6.0_03-b05,mixed mode,sharing)



 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Chiranjeevi Kanthraj wrote:Ya this what i want.. Thanks.

Can we use same for the MySql?



Sorry. No idea abt MySQL. I am DB challenged
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Gurjit Sandhu wrote:Hi
i tried
System.out.println(System.getProperty(("java.version") );
but it gives out null.



Strange.
Works for me.
I get "1.6.0_10" on the console.
Can you please double check your code and see if there is any typo?

Please note the property name "java.version" is case sensitive!
 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Maneesh Godbole wrote:

Chiranjeevi Kanthraj wrote:Ya this what i want.. Thanks.

Can we use same for the MySql?



Sorry. No idea abt MySQL. I am DB challenged



i got
execute the query "select version()" it will give that
 
reply
    Bookmark Topic Watch Topic
  • New Topic