Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing jdk in eclipse

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
like image 854
user1596497 Avatar asked Dec 17 '12 11:12

user1596497


3 Answers

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
like image 68
Art Licis Avatar answered Sep 29 '22 00:09

Art Licis


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
like image 43
FrVaBe Avatar answered Sep 28 '22 22:09

FrVaBe


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.

like image 42
Brian White Avatar answered Sep 29 '22 00:09

Brian White