Hi Sir,
I want to write a program in C++ to find the java version from the system,if java is not loaded in the system then it will show the relevant message like "Java is not loaded in that system"
if java is loaded then it will show the corresponding message that java is loaded in that system and it will also show the java version.
Thank you Sir
Find The Java Version using C++I want to write a program in C++ to find the java version from the sys
Page 1 of 1
3 Replies - 1554 Views - Last Post: 26 October 2007 - 09:46 AM
Replies To: Find The Java Version using C++
#2
Re: Find The Java Version using C++
Posted 26 October 2007 - 02:12 AM
Dude the objective of this forum is to help people learn, so we cannot get your work done unless you show your effort to solve this problem.
This post has been edited by harshakirans: 26 October 2007 - 02:12 AM
#3
Re: Find The Java Version using C++
Posted 26 October 2007 - 07:48 AM
Well, users are crazy. They install java in all kinds of different ways etc. that would mess up most of the easy answers to this question.
"java -version" at the command prompt will give you the version.
So if the user has their java home in the path, well thats all you need.
If not, well there is no standard place for java to be installed at. And, as in the case of my computer, There may be multiple runtime environments installed. (I have three). So it is really best to ask the user where they jave JRE is... and then use "java -version"
"java -version" at the command prompt will give you the version.
So if the user has their java home in the path, well thats all you need.
If not, well there is no standard place for java to be installed at. And, as in the case of my computer, There may be multiple runtime environments installed. (I have three). So it is really best to ask the user where they jave JRE is... and then use "java -version"
#4
Re: Find The Java Version using C++
Posted 26 October 2007 - 09:46 AM
In windows there are registy keys here:
HKLM\Software\JavaSoft\Java Runtime Environment
They might be a good start, but if the user was hacking around and uninstalled some of them by simply deleting by hand, they might not work anymore. Also, it looks-like it's been only going on since 1.5.x, or I might have somehow got rid of my 1.4.2. - which works fine anyway.
So this might be a pointer to places to check.
HKLM\Software\JavaSoft\Java Runtime Environment
They might be a good start, but if the user was hacking around and uninstalled some of them by simply deleting by hand, they might not work anymore. Also, it looks-like it's been only going on since 1.5.x, or I might have somehow got rid of my 1.4.2. - which works fine anyway.
So this might be a pointer to places to check.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|