Eclipse仍然在Mac OSX上使用java 6作为jre [英] Eclipse still using java 6 as jre on Mac OSX

查看:132
本文介绍了Eclipse仍然在Mac OSX上使用java 6作为jre的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在我的Mac上安装了Eclipse SDK 3.7.1,它正在运行mac osx 10.8.4。
我试图让eclipse使用java 7,它安装到/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/
但是当我查看eclipse的安装细节时,它仍然用于我的旧java 6安装。
即使在eclipse.ini文件中添加
-vm
/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java
后, / p>

还编辑了Info.plist文件以指向java 7



这里有任何建议吗?我完全没有想法。



请注意:我是一个带有macs的新手。任何大小的建议将不胜感激:)



Info.plist的内容

 <?xml version =1.0encoding =UTF-8?> 
<!DOCTYPE plist PUBLIC - // Apple Computer // DTD PLIST 1.0 // ENhttp://www.apple.com/DTDs/PropertyList-1.0.dtd\">
< plist version =1.0>

< dict>
< key> CFBundleExecutable< / key>
< string> eclipse< / string>
< key> CFBundleGetInfoString< / key>
< string>适用于Mac OS X的Eclipse 3.7,版权所有IBM Corp.和其他2002年,2011.保留所有权利< / string>
< key> CFBundleIconFile< / key>
< string> Eclipse.icns< / string>
< key> CFBundleIdentifier< / key>
< string> org.eclipse.eclipse< / string>
< key> CFBundleInfoDictionaryVersion< / key>
< string> 6.0< / string>
< key> CFBundleName< / key>
< string> Eclipse< / string>
< key> CFBundlePackageType< / key>
< string> APPL< / string>
< key> CFBundleShortVersionString< / key>
< string> 3.7< / string>
< key> CFBundleSignature< / key>
< string> ????< / string>
< key> CFBundleVersion< / key>
< string> 3.7< / string>
< key> CFBundleDevelopmentRegion< / key>
< string>英文< / string>
< key> CFBundleLocalizations< / key>
< array>
< string> ar< / string>
< string> cs< / string>
< string> da< / string>
< string> el< / string>
< string> en< / string>
< string> es< / string>
< string> de< / string>
< string> fi< / string>
< string> fr< / string>
< string> hu< / string>
< string> it< / string>
< string> iw< / string>
< string> ja< / string>
< string> ko< / string>
< string> nl< / string>
< string> no< / string>
< string> pl< / string>
< string> pt_BR< / string>
< string> pt< / string>
< string> ru< / string>
< string> sv< / string>
< string> tr< / string>
< string> zh_HK< / string>
< string> zh_TW< / string>
< string> zh< / string>
< / array>

< key> Eclipse< / key>
< array>
< string> -vm< / string>< string> /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java< / string>
< string> -keyring< / string>< string>〜/ .eclipse_keyring< / string>
< string> -showlocation< / string>
<! - 警告:
如果您尝试在此添加单个VM参数(-vmargs),则eclipse.ini中指定的
* all * vmargs将被忽略。
我们建议在eclipse.ini中添加所有参数
- >
< / array>
< / dict>

< / plist>


解决方案

如果您试图让VM运行下来更改,那么您需要修改的Info.plist,并且应该在说明如何指定不同VM的部分中进行更改。在我的情况下,我改为使用1.6 VM运行:

 < string> -vm< / string><串GT; /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java< /串GT;在plist的eclipse数组中,



如果你想强制一个特定的1.7 VM,你可以使用:

 < string> -vm< / string>< ;串GT; /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java< /串GT; 

注意,这不是 eclipse.ini ,这是 Eclipse.app/Contents/Info.plist 。这是因为Mac从其他平台启动eclipse的方式略有不同。


I have installed Eclipse SDK 3.7.1 on my mac, which is running mac osx 10.8.4. I am trying to get eclipse to use java 7, which is installed to /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/ But when I view eclipse's installation details it's still using to my old java 6 installation. Even after adding -vm /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java to the eclipse.ini file.

Also edited the Info.plist file to point to java 7

Anyone have any suggestions here? I'm completely out of ideas.

Please note: I am a newbie with macs. Any suggestions, big or small would be greatly appreciated :)

Contents of Info.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

<dict>
    <key>CFBundleExecutable</key>
        <string>eclipse</string>
    <key>CFBundleGetInfoString</key>
        <string>Eclipse 3.7 for Mac OS X, Copyright IBM Corp. and others 2002, 2011. All rights reserved.</string>
    <key>CFBundleIconFile</key>
        <string>Eclipse.icns</string>
    <key>CFBundleIdentifier</key>
        <string>org.eclipse.eclipse</string>
    <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
    <key>CFBundleName</key>
        <string>Eclipse</string>
    <key>CFBundlePackageType</key>
        <string>APPL</string>
    <key>CFBundleShortVersionString</key>
        <string>3.7</string>
    <key>CFBundleSignature</key>
        <string>????</string>
    <key>CFBundleVersion</key>
        <string>3.7</string>
    <key>CFBundleDevelopmentRegion</key>
        <string>English</string>
    <key>CFBundleLocalizations</key>
        <array>
            <string>ar</string>
            <string>cs</string>
            <string>da</string>
            <string>el</string>
            <string>en</string>
            <string>es</string>
            <string>de</string>
            <string>fi</string>
            <string>fr</string>
            <string>hu</string>
            <string>it</string>
            <string>iw</string>
            <string>ja</string>
            <string>ko</string>
            <string>nl</string>
            <string>no</string>
            <string>pl</string>
            <string>pt_BR</string>
            <string>pt</string>
            <string>ru</string>
            <string>sv</string>
            <string>tr</string>
            <string>zh_HK</string>
            <string>zh_TW</string>
            <string>zh</string>
        </array>

    <key>Eclipse</key>
        <array>
            <string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java</string>
            <string>-keyring</string><string>~/.eclipse_keyring</string>
            <string>-showlocation</string>
            <!-- WARNING:
                If you try to add a single VM argument (-vmargs) here,
                *all* vmargs specified in eclipse.ini will be ignored.
                We recommend to add all arguments in eclipse.ini
             -->
        </array>
</dict>

</plist>

解决方案

If you're trying to get the VM that eclipse runs under to change then it's the Info.plist you need to modify, and it should be changed in the section that says how to specify the different VMs. In my case I changed it to run with the 1.6 VM using:

<string>-vm</string><string>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java</string> 

in the eclipse array of the plist.

if you want to force a specific 1.7 VM, you use:

<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java</string>

Note, this is not the eclipse.ini, this is the Eclipse.app/Contents/Info.plist. This is because of the slightly different way that the Mac launches eclipse from other platforms

这篇关于Eclipse仍然在Mac OSX上使用java 6作为jre的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆