How do I run Eclipse using Oracle's new 1.7 JDK for the Mac?

前端 未结 15 2203
执笔经年
执笔经年 2020-11-28 22:47

I\'m trying to get the new 1.7 JDK working with Eclipse (this is Oracle\'s official release).

I don\'t mean just pointing Eclipse to it so you can use it in projects

15条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 23:21

    I just added my comment to https://bugs.eclipse.org/bugs/show_bug.cgi?id=339788 regarding the inability to use the new Oracle JDK with Eclipse on OS X. Using the -vm option inside eclipse.ini does not work. The only way I found to work around this was to use the following shell script:

    #!/bin/sh
    #
    export JAVA_HOME=/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
    LAUNCHER_JAR=/Applications/eclipse/plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    
    java \
    -showversion \
    -XX:MaxPermSize=256m \
    -Xms1024m \
    -Xmx1024m \
    -Xdock:icon=/Applications/eclipse/Eclipse.app/Contents/Resources/Eclipse.icns \
    -XstartOnFirstThread \
    -Dorg.eclipse.swt.internal.carbon.smallFonts \
    -Dosgi.requiredJavaVersion=1.5 \
    -jar $LAUNCHER_JAR
    

    Using the steps on http://mathiasbynens.be/notes/shell-script-mac-apps, I turned the script above into an application that I can keep on my dock.

提交回复
热议问题