Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse still using java 6 as jre on Mac OSX

Tags:

java

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>
like image 312
mrblippy Avatar asked Jul 11 '13 03:07

mrblippy


People also ask

How do I know if JRE is installed in Eclipse?

To check with what Java version (JRE or JDK) Eclipse is running, do the following: Open the menu item Help > About Eclipse . (On the Mac, it's in the Eclipse-menu, not the Help-menu) Click on Installation Details .


1 Answers

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

like image 50
Petesh Avatar answered Nov 10 '22 01:11

Petesh