Running Eclipse on Windows 7 JRE and JDK not found - java

I downloaded the latest Eclipse on Windows 7. When I click the eclipse icon it throws the following exception:
I have already installed JRE and JDK.
UPDATE: Eclipse.ini contents:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m
-vm C:\Program Files (x86)\Java\jre7\bin

According to the Eclipse documentation, you may need to specify the VM before the VM args, and the path should not be on the same line as the -vm switch:
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.
The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
Source: Eclipse Wiki
For example:
-vm
C:\Java\JDK\1.6\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1024m
You also might need to surround your path with some quotes, since it contains spaces. I always install things like Eclipse and Java in root directories with no spaces, not under Program Files, to avoid this problem.

Reference the location of your JRE path in the eclipse configuration file, eclipse.ini.
Note that you only need a JRE to launch Eclipse, but once Eclipse is launched, you should register a JDK for your projects. This is done via
Preferences-> Java -> Installed JREs

Same happened with me on win7. I had 2 folders for 'program files'
Program files
Program Files(x86)
java folder was present on both. For environment variables, I have given the path of java from program files(x86)...\jre6\bin. Then I had downloaded new java 7 version update. Then had tried to open eclipse, it worked and i had not made any changes to eclipse.ini file. My eclipse.ini didnt have any reference to the -vm argument.

I have the same of problem because I was have both the java 1.7 and the java 1.8 and I solved the problem By :
for windows :
first :
open your CMD and write java -version
the result is the current version of java on your pc for exampe the result is 1.8 so
second
open the eclipse.ini and if the path was not the path of current version java (that shown in result of CMD) edit the path to correct path of your java (the version shown in result )
like this :
before I change the path was :
-vm
C:\Program Files\Java\jdk1.7.0_45\jre\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx1024m
after I check of my version of java using CMD the result is : java 1.8
so I change the path and version like this :
-vm
C:\Program Files\Java\jdk1.8.0_45\jre\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
-Xms256m
-Xmx1024m
Nice Day :)

Related

Source Compatibility Issues in Eclipse STS with Java 9

I updated my system to run off of Java 9 primarily and my spring projects are also supporting Java 9. I have an issue however with my Spring Tool Suite (Eclipse 4.7.2) where the program is saying that my code is incompatible with my source level compatibility settings and must be JRE 1.5 and up (parameterized types for example).
In my Project properties my Compiler Compliance Level and Source Compatibility is set to '9'.
In my Window->Preferences, I have set my checked installed JRE to the location of my Java jdk-9.0.1 folder.
Here is my sts.ini (eclipse.ini) file:
STS.ini
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.551.v20171108-1834
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM
-Xms40m
-Dosgi.module.lock.timeout=10
-Xverify:none
-Dorg.eclipse.swt.browser.IEVersion=10001
-Xmx768m
--launcher.appendVmargs
-vm
C:\Program Files\Java\jdk-9.0.1\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM
Any help solving this problem would be greatly appreciated.
The JVM that you specify in your STS.ini is not related in any way to the projects and their compiler levels in your workspace. You can easily run STS on top of a JDK8 and still have projects in your workspace that compile for Java9.
In order to compile projects against a certain level, you have to have a related JDK configured in your preferences. Sounds like that you said that you did that already. There is also a sub-section called "Execution Environment", where you can specify which JDK on your machine should be used for which Java language level. Make sure that you have the right JDKs selected there.
Your STS.ini looks broken: there should be only a single -vmargs section; -vm and --launcher.appendVmargs must be above -vmargs:
Remove the last three lines (which are duplicated lines) and move --launcher.appendVmargs, -vm and the following line above -vmargs:
-startup
plugins/org.eclipse.equinox.launcher_1.4.0.v20161219-1356.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.551.v20171108-1834
-product
org.springsource.sts.ide
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:\Program Files\Java\jdk-9.0.1\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.8
--add-modules=ALL-SYSTEM
-Xms40m
-Dosgi.module.lock.timeout=10
-Xverify:none
-Dorg.eclipse.swt.browser.IEVersion=10001
-Xmx768m
For those who come across the same issue in the future: I solved the issue, but neither of the previously posted corrected the issue (although they were helpful). I followed the steps here and added the '-clean' line to my sts.ini file and restarted eclipse.

Can't Open Eclipse "No Java virtual machine was found"

I've checked the other relative common posts to mine but they a slight difference that didn't give me the solution I needed:
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations:
C:\Program Files (x86)\Java\jdk1.80_25\jre\bin\javaw.exe
I have checked over and over in that path, and javaw.exe is definitely there. Any ideas what to do, I had a exit-13 problem before I followed a step to add
"-vm "path to javaw.exe" in my eclipse.ini but I don't know what to do now.
My eclipse.ini file:
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20150204-1316
-product
org.eclipse.epp.package.cpp.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files (x86)\Java\jdk1.8.0_25\jre\bin\javaw.exe
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms40m
-Xmx512m
Got it to work, uninstalled all my Java's, reinstalled jdk (x86) in my case, installed newest jre (x64) to delete obsolete ones from the jdk and it worked. THanks everyone
-vm
C:\Program Files (x86)\Java\jdk1.8.0_25\jre\javaw.exe
should be something like
-vm
C:/Program Files (x86)/Java/jdk1.8.0_25/
or even better:
-vm
C:/Program Files (x86)/Java/jre1.8.0_25/bin/server/jvm.dll
On a side note, download the 64bit version if you can
The potential problem is you are using 64 bit Eclipse but 32 bit java. Either use 32 bit eclipse or install 64 bit java and re-try. It all started with Java 7!
Just copy this file:
C:/Program Files/Java/jre(5,6,7...whatever version)/bin/javaw.exe
to the Eclipse folder (directory where the eclipse.exe is located)
Please note: Only tested for Windows
Alternatively, right click on Eclipse icon, select Properties and edit Target field.
There will be a large string, edit it to point to correct javaw.exe path:
-vm "c:/Program Files/Java/jdk1.8.0_65/bin/javaw.exe"

Eclipse cannot find JDK

I'm installing Eclipse (adt-bundle-linux-x86_64). I placed the files in my /opt/ folder and when I try to run eclipse it give me a pop up saying
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/opt/adt-bundle-linux-x86_64-20140702/eclipse/jre/bin/java
java in your current PATH
So I attempted to add the java path to the eclipse.ini file by adding
-vm /opt/jdk1.80_20/bin/java
But I still get the same error pop up (it didn't change at all, I expected it to say the path I added to the .ini file but it stayed the same.)
I then tried to create a symbolic link in the /opt/adt-bundle-linux-x86_64-20140702/eclipse/jre/bin/ folder pointing to /opt/jdk1.8.0_20/jre/bin/java and it now gives me a new pop up saying
>JVM terminated. Exit code=1
/opt/adt-bundle-linux-x86_64-20140702/eclipse/jre/bin/java
-vm /opt/jdk1.8.0_20/bin/java
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms512m
-Xmx1024m
-jar /opt/adt-bundle-linux-x86_64-20140702/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
-os linux
-ws gtk
-arch x86_64
-showsplash /opt/adt-bundle-linux-x86_64-20140702/eclipse//plugins/org.eclipse.platform_4.2.2.v201302041200/splash.bmp
-launcher /opt/adt-bundle-linux-x86_64-20140702/eclipse/eclipse
-name Eclipse
--launcher.library /opt/adt-bundle-linux-x86_64-20140702/eclipse//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20120913-144807/eclipse_1502.so
-startup /opt/adt-bundle-linux-x86_64-20140702/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.overrideVmargs
-exitdata 330012
-product com.android.ide.eclipse.adt.package.adtproduct
-vm /opt/adt-bundle-linux-x86_64-20140702/eclipse/jre/bin/java
-vmargs
-vm /opt/jdk1.8.0_20/bin/java
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms512m
-Xmx1024m
-jar /opt/adt-bundle-linux-x86_64-20140702/eclipse//plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
I have two questions:
1. Why does adding the line to the eclipse.ini file not change the path
2. How do I set the correct path for eclipse to run?
Thanks
I'd guess, to read the eclipse.ini file you would already have to be running something. And that would be the java executable.
Did you try to:
set JAVA_HOME to the address you have your java environment, and
set your PATH variable to include java home, like set PATH=%JAVA_HOME%/%PATH% ?
I followed the steps outlined in http://www.blogs.digitalworlds.net/softwarenotes/?p=54 after deleting and reinstalling the JDK and deleting Eclipse. I still got the pop-up error but I created a symbolic link at the path it requested pointing to Java
ln -s /opt/jdk1.8.0_25/jre/bin/java jre/bin/java
This finally worked to get Eclipse to run.

how to run eclipse by using a specified java path directory in eclipse not by the default Java path

I want to set java path to a specified java directory in eclipse, not the default installed java path. I want to run eclipse by using java from my specified path. But all the time eclipse runs by using the default installed java path. I have specified the Path in the "eclipse.ini" file but this path is not used by eclipse to run.. Please hep me...
This is my "eclipse.ini" file
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.adtproduct
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
/home/bibin/Documents/ADTBUNDLE/jdk1.6.0_17/bin/java
-vmargs
-Dosgi.requiredJavaVersion=1.6
-XX:MaxPermSize=256m
-Xms512m
-Xmx1024m
#Bibin Jose I think you're confused, The eclipse.ini is a file where the eclipse configuration to start is. In "Windows>>preference>>java>>installed JRE" is where you can set which JRE you want to compile you project. You can add a lot of JRE in preference.
If you want, click in "Add" button, choice "Standar VM" and click in next button, finally set the path where your other jdk is installed.

On starting eclipse, it gives an error "Java was started but returned exit code=13"

I am trying to start eclipse after installing java 7 and adding the line
-vm
C:\Progra~2\Java\jdk1.7.0_45\bin\javaw.exe
to the eclipse.ini file. Still i am getting the error "Java was started but returned exit code=13".
I just want to know how to start eclipse. Even if i have to install eclipse, java, jre all over again.
Any suggestion will do!
My eclipse.ini file:
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Progra~2\Java\jdk1.7.0_45\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
On pasting the jre in eclipse folder i am getting this error:
All you have to do is to put the new jdk path in eclipse.ini
-vm
C:\Program Files\Java\jdk1.8.0_11\bin\javaw.exe
or the your new jdk path.
make sure that you type the above just before the -vmargs and after the OpenFile
that solved my problem
Check that you have installed the correct java that your OS requires. Meaning, if you are running a 64 bit OS then you need 64 bit java and the same for 32 bit.
Check eclipse.ini file, and in particular format of the vm option (look here for more):
Note the format of the -vm option - it is important to be exact:
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.
The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.
Another thing to check is that bit version (32/64) of JVM should match bit version of eclipse (32/64).

Categories