score:0
I too faced same issue while running eclipse with different version then default on the system.
I created a symlink of required jre directory under eclipse directory and then it was all working.
For windows user: symlink is similar to creating shortcut
Hope it helps you too.
score:1
If you want to make sure you are running you java apps in Windows 7 with an specific java version:
1 - Check out what which version is running by default. Run cmd to go to the console and type: java -version
C:>java -version
java version "1.6.0_45" Java(TM) SE Runtime Environment (build 1.6.0_45-b06) Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)
2 - Change the default jdk by changing the path. Example here. Make sure you java.exe from your desired jdk is before any other java.exe from any other JDK in the path. ex. in JDK 1.6 you java.exe should be here C:\java\jdk1.6\bin\java.exe.
Once you have changed the path, open a new console and verify again which jdk version you are running.
3 - Make sure in eclipse.ini param -vm another jre version is not set.
score:1
I modified eclipse.ini file as follows (added my local JDK path) and it fixed eclipse loading issue.
-vm
C:\Program Files\Java\jdk1.8.0_251\bin
score:4
These two options worked for me on Windows:
Edit eclipse.ini
-vm C:/Java/jdk1.7.0_71/jre/bin -vmargs ...
Copy jre folder to eclipse folder.
So after the copy I have C:\eclipse\jre folder which is a copy of C:\Java\jdk1.7.0_71\jre
score:6
Since none of the answers worked for me this is my solution:
I downloaded java 6 and i installed it. Then in the program files , inside the folder of java , i copied the folder jre6. I pasted it inside the eclipse folder and renamed it jre.
Thats it! When inside the eclipse installation folder your have a folder named jre , then the java in there is the java that eclipse will run with.
Thank you all for your answers!
score:8
Many hints given already. Anyway I will just provide the recommended way of doing it which might help for future reviews of that question:
- Use the eclispe.ini file (folder where the eclipse binary resides)
- Add the -vm option with the path of the jre to startup with
i.e Windows
-vm
C:\Java\jdk1.6.0_45\jre\bin\javaw.exe
i.e Linux
-vm
/opt/sun-jdk-1.6.0.02/bin/java - The -vm option must occur after the other Eclipse-specific options (such as -product, --launcher.*, etc), but before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
- The -vm option and its value (the path) must be on separate lines.
- The value must be the full absolute or relative path to the Java executable, not just to the Java home directory.
score:20
Do this:
1. Go to the folder where eclipse is installed (the one that has the eclipse.exe program in)
2. Open the text file eclipse.ini with notepad or something similar
3. Add the following lines to specify the JVM location using the -vm argument
-vm
c:/jre/bin/javaw.exe
Now start eclipse in the usual way.
Make sure to position the -vm argument before -vmargs, since the latter is passed to the VM on startup it will be too late to set the VM after this.
More info is available on the Eclipse wiki
You could also have changed the system path as per one of the other answers but this would change the JVM being used for the whole system. If you use the eclipse.ini settings it allows everything else to use the latest JVM.
score:32
Note that option -vm C:\Java\jre6\bin\javaw.exe
should be right before -vmargs
. Otherwise you'll get 'Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit'
score:81
- Open eclipse config file
eclipse.ini
in your Eclipse folder. Add
-vm yourPath\Java\jre6\bin\javaw.exe
like:-startup plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20120522-1813 -product org.eclipse.epp.package.java.product --launcher.defaultAction openFile --launcher.XXMaxPermSize 256M -vm C:\Java\jre6\bin\javaw.exe ...
If the path contains spaces there is no need to escape them, see the Eclipse Wiki for more specs. The -vm
option and the path must be on separate lines. The -vm
option must come before the -vmargs
option. On Linux, the path would typically be /bin/java
instead of the Windows path shown above. You must use the Java and Eclipse versions must match (i.e. 32-bit Eclipse runs on 32-bit Java and 64-bit Eclipse runs on 64-bit Java).
Source: stackoverflow.com
Related Query
- How to run Eclipse with different Java version?
- Eclipse - compile and run with different Java version
- How Can I Tell Eclipse to Compile and Build a Project with a Different JRE Version than it Normally Does?
- How to run JSR269 annotaion processor in Eclipse Kepler with Java 7 & Maven
- How to use different version of IE (IE6, 7, 8, 9 and 10) in Selenium WebDriver with Java
- How to start eclipse with different version of Java?
- how to run a .jar 1.7 program with an older version java 1.6?
- How to copy my Java Eclipse project to desktop, and then run with the command line?
- How to run a script which has Java command via Eclipse IDE such that I see the output and interact with the program?
- How can I configure eclipse to run my java program with extra arguments?
- How do I run a project in eclipse with different jboss-ejb-client.properties
- How to run Spock tests for Java project with eclipse and gradle?
- How to run a same project with two different names in Eclipse
- How to make Eclipse RUN patched JRE modules on JDK9+ with the —patch-module java option
- How to run Java SE 6 with RMI commands on Windows with Eclipse
- How to debug a jar in eclipse when run with this command java -jar target/TextSecureServer-1.22.jar server config/development.yml
- How to run & debug multiple java programs with one Ant buildfile on seperate consoles in Eclipse
- How to run with old version of Junit 4 in Eclipse (Galileo)
- How to run a java class in Eclipse (part of a maven project with a pom file) from cmd
- How to run a .java file created in Eclipse on windows command prompt with java cmd?
- How to run eclipse luna mac os with java 7
- How can I run my program with many different arguments in Eclipse
- how to run java web application in eclipse with current modification in file
- How to run Java source file with multiple packages using Eclipse
- How to run a simple java client on Eclipse to communicate with a mobile server
- How to downgrade Java from 9 to 8 on a MACOS. Eclipse is not running with Java 9
- How to simultaneously run all JUnit tests for a Eclipse Java project without Maven?
- How to create the pom.xml for a Java project with Eclipse
- how do I get eclipse to use a different compiler version for Java?
- How to reference a different Java project in Eclipse
More Query from same tag
- Eclipse: path variables expand to relative instead of absolut path
- Eclipse plug-in on project loaded
- Eclipse hangs intermittently on PC without internet connection
- Eclipse locks up PC on first launch
- Adding license to new files when using Eclipse and the Copyright wizard plugin
- Found a random plus sign, no syntax error
- Duplicate src packages when importing an existing project in Eclipse
- How to Access Guest Resources from Host?
- Store information about method parameters (usable via reflection) in intellij 13
- add new packages to SDK manager
- SQL Server 2005 connection with java.
- Maven build outside eclipse, very time consuming
- Is there any way of configuring Eclipse IDE proxy settings via an autoproxy configuration script?
- How to make all fonts bold in Eclipse?
- Import Java Project, not found src
- Change .jar name in MacOS dock in Eclipse?
- Unable to install the Parse SDK on Eclipse
- Why isn't my dependency listed in my manifest.mf?
- Choose which runnable class of a project should be loaded
- Unable to install ADT on Eclipse 4.2
- Eclipse RCP Plugin Project top bar closed (contained View), cannot reopen it even after relaunch
- RobotFramework: when i get content of web service the results is text
- Eclipse built-in shell
- How to Get Eclipse, Maven and Google PlayN to work together?
- My eclipse luna won't start up
- Using Git with Eclipse causing lots of errors
- Eclipse Servers view not showing added Tomcat runtime environment
- unfortunately app has stopped in eclipse
- how can I get the values of ComboFieldEditor?
- Make ADT Code Assist work like Xcode autocomplete