aspose file tools*
The moose likes Beginning Java and the fly likes how can i know the JVM is already installed on my computer ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how can i know the JVM is already installed on my computer ?" Watch "how can i know the JVM is already installed on my computer ?" New topic
Author

how can i know the JVM is already installed on my computer ?

Hiep Nguyen
Ranch Hand

Joined: Oct 26, 2001
Posts: 46
hello !
how can i know the JVM is already installed on my computer ?
thank you !
Gaurav Mac Mathur
Ranch Hand

Joined: Feb 19, 2002
Posts: 47
Which OS ?
for Windows you can find out in Add Remove Program, or by simpally typing java or javac on Command window.
for MAC check for Library/Java/Home/ **** folder.
cheers
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
You can search for a file named javac.exe


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Hiep Nguyen
Ranch Hand

Joined: Oct 26, 2001
Posts: 46
thanks you for your advices!!!
last time i don't tell detaily my request. i use Window OS, now i want to know how an Application can know that my computer is installed JVM or not?
thank you !!!
bharat nagpal
Ranch Hand

Joined: Oct 26, 2002
Posts: 76
how can javac.exe ensure that JVM is installed on the machine?
Neelima Paramsetty
Greenhorn

Joined: Jun 17, 2003
Posts: 16
if u type javac at command promt it must display the javac options,then only we confirm that JVM is installed
Gaurav Mac Mathur
Ranch Hand

Joined: Feb 19, 2002
Posts: 47
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
bharat nagpal
Ranch Hand

Joined: Oct 26, 2002
Posts: 76
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.
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
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.


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can i know the JVM is already installed on my computer ?