0
votes

My Mac is a fresh install of OS X. I also downloaded the latest ADT (Android Developer Tool)

I downloaded Java 7u51 Developer Kit and installed it. I launched Terminal and typed

java -version

I get the following output

java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)

I know that Java is installed so I launched Eclipse.app but it was asking to install Java 6.

Then I used Terminal to navigate to the path of the eclipse folder and typed

open Eclipse.app

Output

LSOpenURLsWithRole() failed with error -10658 for the file /Applications/adt-bundle/eclipse/Eclipse.app.

Then when I did this

cd Eclipse.app/Contents/MacOS/ open eclipse

It worked without any issues. However I would rather not use Terminal to launch Eclipse. Is there any workaround of fix to prevent me from installing Java 6?

2

2 Answers

0
votes

edit the Eclipse.app/Contents/Info.plist file, and it mentions if you need to use a specific version of the JDK you should use one of the lines:

<!-- to use a specific Java version (instead of the platform's default) uncomment one of the following options:
<string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.4.2/Commands/java</string>
<string>-vm</string><string>/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Commands/java</string>
-->

In the case of current java (2014-03-05), you should make it:

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

execute command ls /Library/Java/JavaVirtualMachines/

find jdk1.7.0_71.jdk or other

edit the Eclipse.app/Contents/Info.plist file

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