Background: I've got a new eclipse installation and have installed the m2eclipse plugin. After startup m2eclipse generates the message:
Eclipse is running in a JRE, but a JDK
is required
Following the instructions from here I've changed the eclipse.ini file to use the JDK JVM:
-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-vm
"C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe"
After restarting eclipse however, I still get the message saying its running under the JRE and not the JDK.
Looking at the eclipse configuration via Help -> About Eclipse -> Installation Details -> Configuration it seems like eclipse is picking up the JVM configuration details from somewhere else:
...
-vm
C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
eclipse.home.location=file:/C:/Program Files (x86)/eclipse/
eclipse.launcher=C:\Program Files (x86)\eclipse\eclipse.exe
eclipse.p2.data.area=#config.dir/../p2/
eclipse.p2.profile=epp.package.jee
eclipse.product=org.eclipse.epp.package.jee.product
eclipse.startTime=1252669330296
eclipse.vm=C:\Program Files (x86)\Java\jre6\bin\client\jvm.dll
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-vm
"C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe"
-XX:MaxPermSize=256m
...
My question is where is the first -vm argument coming from and how can I remove or change it?
Thanks
Update: I have updated the eclipse.ini file as per VonC's answer. I'm now getting an error when launching eclipse 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: "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe"
I've confirmed that the path is correct and can be executed via the command line.
Complete eclipse.ini below:
-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
"C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe"
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
Solution: it seems like there was still something wrong with the eclipse.ini file. I replaced it completely with the settings given by VonC in the post he linked and eclipse is now starting properly and using the correct JVM. Full eclipse.ini below for anyone else with the same problem:
-showlocation
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
384m
-startup
plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-vm
C:\Program Files (x86)\Java\jdk1.6.0_16\jre\bin\client\jvm.dll
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms128m
-Xmx384m
-Xss4m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseConcMarkSweepGC
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-Dcom.sun.management.jmxremote
-Dorg.eclipse.equinox.p2.reconciler.dropins.directory=C:/jv/eclipse/mydropins
See:
eclipse.ini for 3.4 or
eclipse.ini for 3.5
for an example of parameters order.
-vm should be before -vmargs
Update 6 years laters (2015)
E Riz mentions in the comments that the new Eclipse Installer will detect the JVM for you, or propose ones to download.
Unbelievable, the solution to this problem for me has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, ....
The answer is that you have to have a line break between -vm and the path.
So in the eclipse.ini file:
THIS WILL NOT WORK:
-vm C:\java\jdk\bin\javaw.exe
BUT THIS WILL:
-vm
C:\java\jdk\bin\javaw.exe
I think your machine is 64bit windows?
I cannot see a 64bit windows version of eclipse in the site. So only 32 bit might be available.
Are you sure you have a 32bit JDK installed in your machine?
Just a thought...
If you're using Windows, right click on your eclipse shortcut and select Properties, in the Shortcut tab you can change what's in the Target: box to specify the jdk. I use
"C:\Program Files\eclipse-jee-galileo-sr1 (3.5.1)\eclipse.exe" -vm "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe" -vmargs -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode
For some reason I couldn't get it to use the jdk when I tried editing the eclipse.ini file.
Howto start eclipse in JDK?
This also addressed in Eclipse documentation:
https://wiki.eclipse.org/Eclipse.ini#-vm_value:_Windows_Example
My issue was that
-vm
"C:\Program Files\Java\jdk1.7.0_67\jre\bin\javaw.exe"
the path was in quotes, when i removed the quotes it worked:
-vm
C:\Program Files\Java\jdk1.7.0_67\jre\bin\javaw.exe
You should mention the full path of javaw.exe after -vm argument without using double quotes, i.e. "", each of -vm and the path has to be in different lines and -vm must be before -vmargs. For example:
-vm
C:\Program Files\Java\jrockit-jre1.6.0_45-R28.2.7\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
-XX:+UnlockDiagnosticVMOptions
-XX:MaxClassBlockMemory=75M
I solve this question.
When you create a Maven Project in Eclipse maybe the text file encoding in this project's properties and the project.build.sourceEncoding in the pom.xml was not the same. When you build this project it would report "Unable to locate the Javac Compiler in:..." error, too.
For example, my text file encoding was GBK and project.build.sourceEncoding was UTF-8 so this error happened. I just modified the text file encoding to UTF-8.
Related
I am using java 1.6. I have 64 bit W7OS. When I start Eclipse, I receive the exit code=13 error message.
I have seen some solutions for this and I went into the eclipse.ini file and added in the path to java 1.6. This is the .ini file now. I added in the '-vm' and the following line of C:...
-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20130521-0416
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vm
C:\Program Files\Java\jre6\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
I understand that the Internet thinks that this has to do with my OS being 64-bit and Eclipse trying to run 32 bit version or something, but I do not understand the solutions given for that. What should I do?
Thank you in advance.
You don't have to reinstall java.
Go to C:\Program Data\Oracle\java and check the path the shortcuts java, javaw and javaws are pointing to.
If the shortcuts are not pointing to the correct 64-bit java path, delete the shortcuts and create new ones with the same name and change the target location of the program to the 64bit java (jdk\bin{java or javaws or javaw}) location.
I had this problem and was generated by the symlinks in C:\ProgramData\Oracle\Java\javapath the javaw symlink was pointing to the 32bit version.
I removed and created a new javaw symlink whith this command on the command prompt running as admin: mklink \javaw "C:\Program Files\Java\jdk1.8.0_60\bin"
The last arg og the command is where 64bit javaw is placed.
Hope this helps!
I am trying to update my eclipse to work with a jdk and not a jre.
I followed the instruction in this forum , also search google for answers but for some reason it still don't work.
I try'ed going to preferences ->java->install jre's , removing the old jre from there and using the path for the jdk.
also try'ed going to project properties -> java build path -> jre system libraries -> edit-> workspace default jre.it also says there i'm using jdk.
I even try'ed adding to the ini file the next path C:\Program Files\Java\jdk1.6.0_31\bin\javaw.exe
but when i try'ed deploying my program to app engine i get the next message :
Unable to update app: Cannot get the System Java Compiler. Please use a JDK, not a JRE.
my eclipse version is juno 4.2 and my jdk version is 1.6.0_31
I don't know what else i need to change. I even uninstall my older jre from my computer but eclipse still don't work with the jdk ( although it recognize it )
I'm out of idea's ... anyone could help me please ??
this is my ini file :
-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.v20120522-1813
-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\Java\jdk1.6.0_31\bin
thanks for the help
If you want to change JVM Eclipse itself should run on, the right place for that is eclipse.ini. Here are instructions on how to specify that: eclipse.ini.
Common mistakes are specifying -vm parameter name and the value in one line, or missing '-vm', or misplacing it. Also, pay attention to -vm format on different OSes.
EDIT (after .ini file published): your -vm option comes after -vmargs, which is wrong (both lines are treated as VM args). The correct parameter placement in your .ini file would look like this:
...
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Program Files\Java\jdk1.6.0_31\bin
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m
Below you can find my eclipse ini where I set a dedicated JDK via
-vm C:/Program Files (x86)/Java/jdk1.7.0_10/bin/javaw.exe
Have a look at the section "Specifiying the Java Virtual Machine" in the eclipse help.
Quote:
Tip: It's generally a good idea to explicitly specify which Java VM to use when running Eclipse. This is achieved with the "-vm" command line argument as illustrated above. If you don't use "-vm", Eclipse will look on the O/S path. When you install other Java-based products, they may change your path and could result in a different Java VM being used when you next launch Eclipse.
-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.v20120522-1813
-vm
C:/Program Files (x86)/Java/jdk1.7.0_10/bin/javaw.exe
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-vmargs
-Dorg.eclipse.ecf.provider.filetransfer.httpclient.retrieve.readTimeout=999999
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms128m
-Xmx1024m
None of the other answers worked for me. I eventually just removed the "jre7" directory and, presto-chango, Eclipse started using the JDK that was installed next to it.
I am trying to get my Eclipse on OS X to start up using JDK 1.6 rather than the JDK 1.5 that it normally uses. I have edited my eclipse.ini file (Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini) to the following:
-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.100.v20110502
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
-vmargs
-Xms40m
-Xmx384m
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
but when I start up Eclipse and go to About Eclipse SDK → Installation Details → Configuration it still says (among other things)
java.endorsed.dirs=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/lib/endorsed
java.home=/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
java.runtime.name=Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version=1.5.0_30-b03-389-9M3425
java.specification.version=1.5
java.version=1.5.0_30
Can someone please tell me what I'm doing wrong here? Thanks.
java.vm.version=1.5.0_30-161
I believe that the -vm setting must be the first two lines of the eclipse.ini file.
what do I need to write in my eclipse.ini to get rid of this warning:
The Maven Integration requires that Eclipse be running in a JDK,
beacuase a number of Maven core plugins are using jars from the JDK.
Please make sure the -vm options in eclipse.ini is pointing to a JDK
and verify that Installed JREs are also using JDK installs.
My ini says this and the problem is not solved:
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.2.R36x_v20101222
-showsplash org.eclipse.platform
--launcher.XXMaxPermSize 256m
--launcher.defaultAction openFile
-product org.eclipse.epp.package.java.product
--launcher.defaultAction openFile
--launcher.XXMaxPermSize 256M
-vm C:\Program Files\Java\jdk1.6.0_25\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m
Update: The above definitely doesn't change my vm I checked it according to this answer and it says I'm still running eclipse.vm=C:\Windows\System32\javaw.exe
Update2: A suggested on several websites I tried to run eclipse from the commandline as .\eclipse -vm "..\Java\jdk1.6.0_25\bin\javaw.exe" and it worked!!! In "Eclipse Installation Details"->"Configuration" it now says eclipse.vm=C:\Program Files\eclipse\\..\Java\jdk1.6.0_25\bin\javaw.exe
Did you try using slashes instead of backslashes for the folder of your jdk?
As has been suggested in other answers you should both change backslashes to forward slashes in your JDK path and put -vm and the JDK path on different lines. This is what works for me:
-vm
C:/Program Files (x86)/Java/jdk1.6.0_26/bin/javaw.exe
I have these two lines as the first ones in my eclipse.ini file, but that should not be required.
Here is my eclipse.ini (eclipse 3.6) and maven works fine
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m
I just downloaded eclipse from official site, download maven 2.2.1 from apache site, installed
m2eclipse - http://m2eclipse.sonatype.org/sites/m2e
m2eclipse Extras http://m2eclipse.sonatype.org/sites/m2e-extras
(Install new software)
Set up my maven installation in Window->Preferences->Maven->Installations
and that's all for me to work with maven.
Have you tried an enter between -vm and the java path? I think it needs a new line. You can also try pointing to the jvm.dll instead of the .exe
I installed the Maven plugin for Eclipse, and then I got an error like below:
please make sure the -vm option in eclipse.ini is pointing to a JDK
How do I use the -vm option to point to my JDK in eclipse.ini?
My solution is:
-vm
D:/work/Java/jdk1.6.0_13/bin/javaw.exe
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256M
-framework
plugins\org.eclipse.osgi_3.4.3.R34x_v20081215-1030.jar
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
eclipse.ini file must have -vm on the first line and a path on the second line. Don't try to put everything into one line!
-vm
C:\Program Files\Java\jdk1.6.0_07\bin\javaw.exe
Anything after the "vmargs" is taken to be vm arguments. Just make sure it's before that, which is the last piece in eclipse.ini.
There is a wiki page here.
There are two ways the JVM can be started: by forking it in a separate process from the Eclipse launcher, or by loading it in-process using the JNI invocation API.
If you specify -vm with a path to the actual java(w).exe, then the JVM will be forked in a separate process. You can also specify -vm with a path to the jvm.dll so that the JVM is loaded in the same process:
-vm
D:/work/Java/jdk1.6.0_13/jre/bin/client/jvm.dll
You can also specify the path to the jre/bin folder itself.
Note also, the general format of the eclipse.ini is each argument on a separate line. It won't work if you put the "-vm" and the path on the same line.
-vm
C:\Program Files\Java\jdk1.5.0_06\bin\javaw.exe
Remember, no quotes, no matter if your path has spaces (as opposed to command line execution).
See here: Find the JRE for Eclipse
My solution for Ubuntu Linux:
-vm
/home/daniel/Downloads/jdk1.6.0_17/bin
-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.2.R36x_v20101019_1345
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m
I am not sure if something has changed, but I just tried the other answers regarding entries in "eclipse.ini" for Eclipse Galileo SR2 (Windows XP SR3) and none worked. Java is jdk1.6.0_18 and is the default Windows install. Things improved when I dropped "\javaw.exe" from the path.
Also, I can't thank enough the mention that -vm needs to be first line in the ini file. I believe that really helped me out.
Thus my eclipse.ini file starts with:
-vm
C:\Program Files\Java\jdk1.6.0_18\bin
FYI, my particular need to specify launching Eclipse with a JDK arose from my wanting to work with the m2eclipse plugin.
You have to edit the eclipse.ini file to have an entry similar to this:
C:\Java\JDK\1.5\bin\javaw.exe (your location of java executable)
-vmargs
-Xms64m (based on you memory requirements)
-Xmx1028m
Also remember that in eclipse.ini, anything meant for Eclipse should be before the -vmargs line and anything for JVM should be after the -vmargs line.
The JDK you're pointing to in your eclipse.ini has to match the Eclipse installation.
If you are running a 32- or 64-bit Eclipse, use a 32 or 64-bit Java JDK, respectively.
I'd like to share this little hack:
A click on the Eclipse's icon indicated a problem with the JRE.
So, I put this command in the destination field of the icon's properties:
C:\...\eclipse.exe -vm c:\'Program Files'\Java\jdk1.7.0_51\jre\bin\javaw
Thinking that the "'" would solve the problem with the space in the path.
That did not function. Then, I tried this command:
C:\...\eclipse.exe -vm c:\Progra~1\Java\jdk1.7.0_51\jre\bin\javaw
with success
Assuming you have a jre folder, which contains bin, lib, etc files copied from a Java Runtime distribution, in the same folder as eclipse.ini, you can set in your eclilpse.ini
-vm
jre\bin\javaw.exe
I know that there exists a command line option, -vm, to specify the path to the executable of the Java runtime. This may be the same as in eclipse.ini.
-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.v20140603-1326
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms2000m
-Xmx3512m