Search code examples
javaeclipsejava-6

Pointing eclipse to JRE 1.7 instead of 1.6


I am getting error whenever I click eclipse icon that version 1.6 of the jvm is not suitable for this product. Version 1.7 or greater is required.

My other java applications in the system are using JRE 1.6 so I dont want to change that.

I have JDK 7 in my system as well but how can I point my eclipse to JDK 1.7 instead of default 1.6.

Thanks


Solution

  • You have several options.

    Since you want to default to Java 1.6 for most of your other applications, I'd suggest modifying your Eclipse.ini:

    https://wiki.eclipse.org/Eclipse.ini

    EXAMPLE:

    -startup
    plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
    -product
    org.eclipse.epp.package.java.product
    --launcher.defaultAction
    openFile
    --launcher.XXMaxPermSize
    256M
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256m
    --launcher.defaultAction
    openFile
    -vm
    C:\Java\JDK\1.8\bin\javaw.exe
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms40m
    -Xmx1024m