Forums Register Login

JVM for jar

+Pie Number of slices to send: Send
How do I find which JVM is being used for a jar file?

Please help.
+Pie Number of slices to send: Send
Define "which JVM." JVM version, or path to the executable? If it's the former, just check the "java.version" system property. If it's the latter, you may be able to use Class.getResource() to get a file:// URL for a System class file, then examine the URL for a local path.
+Pie Number of slices to send: Send
The system I am wokring on may be having multiple versions of JVM. SO I guess to find version I will have to go second route you pointed.
This might be bigginer question, Can you eloborate how do I use Class.getResource?
I have .jar files in a directory and I want to find which JVM each one is using.

Thanks for your reponse
Gemini
+Pie Number of slices to send: Send
 

Originally posted by Gemini Moses:

I have .jar files in a directory and I want to find which JVM each one is using.



Nothing about a jar file itself will tell your computer what JVM to use; it depends only and entirely on your computer's settings. If we're talking about a jar file you double-click to execute, then you need to look at the OS's file association for jar files, and possibly (if the association doesn't specify a path) your PATH environment variable to see which version of "java" is first on the path.

Is that all you're asking?
+Pie Number of slices to send: Send
Got you. Thanks!
+Pie Number of slices to send: Send
java -version
Well behaved women rarely make history - Eleanor Roosevelt. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1415 times.
Similar Threads
jar file convertion from 32 bit to 64 bit
Suddenly getting java.lang.NoClassDefFoundError
WA #2 ..... word association
Regarding Jar File
Using the Application database connection from an application
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 02:12:24.