File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting Version Numbers

 
Chiranjeevi Kanthraj
Ranch Hand
Posts: 290
Hibernate Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • 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

 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya this what i want.. Thanks.

Can we use same for the MySql?
 
Gurjit Sandhu
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic