How do I know what version of Java is being run in Eclipse?
Is there a way to write code to find out?
Is "JRE System Library [JavaSE-1.6]" in "Package Explorer" the right version?
How do I know what version of Java is being run in Eclipse?
Is there a way to write code to find out?
Is "JRE System Library [JavaSE-1.6]" in "Package Explorer" the right version?
try this :
compile and run. it will return either 32 or 64 as per your java version . . .
Don't about the code but you can figure it out like this way :
Go into the 'window' tab then preferences->java->Installed JREs. You can add your own JRE(1.7 or 1.5 etc) also.
For changing the compliance level window->preferences->java->compiler. C Change the compliance level.
There are various options are available to test which java version is using your eclipse. The best way is to find first java installed in your machine.
run java -version command on terminal
then to check whether your eclipse pointing to the right version or not.
For that go to
Eclipse >> Preferences >>Java >>Installed JREs
Eclipse uses the default Java on the system to run itself. This can also be changed in the eclipse.ini file in your eclipse install folder.
To find out the version of java that your eclipse project is using, see Project->properties->build path->Libraries tab and see the JRE system library thats being used. You can also check it out at Window->Preferences->Java->Installed JREs. This is a list of all JREs that eclipse knows about
To find out using code, use the System.getProperty(...) method. See http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#getProperties() for supported properties.
The one the eclipse run in is the default java installed in the system (unless set specifically in the eclipse.ini file, use the -vm option). You can of course add more Java runtimes and use them for your projects
The string you've written is the right one, but it is specific to your environment. If you want to know the exact update then run the following code:
If you want to check if your
-vm eclipse.ini
option worked correctly you can use this to see under what JVM the IDE itself runs: menu Help > About Eclipse > Installation Details > Configuration tab. Locate the line that says:java.runtime.version=...
.