if u type javac at command promt it must display the javac options,then only we confirm that JVM is installed
Gaurav Mac Mathur
Joined: Feb 19, 2002
Let me rephrase the Original Question by HN. what he intend to ask is how a Application he is developing "Possibally in Java" Get access to the local sytem and determine if JVM is good and working on the machine. I dont have any Solid Answer for this, but you can access teh CLASSPATH using teh System class and see if JDK_HOME is set there. ( _This is not the best/fool proof way_ ) Cheers
Joined: Oct 26, 2002
javac is java compiler. I don't think checking the javac will ensure this. and It's not that JAVA_HOME is always there. As far as I know in windows you can check this entry in registry.
This seems like a "chicken before the egg" question since the JVM must be installed before your Java application can run. In order to to ensure that the JVM is installed before a user runs the application you wrote you should use an installation tool. These kinds of tools can make sure the correct components are installed for your application. I see many Java-based programs that use Install Anywhere. There are probably others as well, but I am not familiar with them. If a JVM is already installed, these tools can also detect if it is the correct version. Alternatively, there is probably a way to check the version once your program is running. As stated earlier, this still requires some version of the JVM to be installed already.