title: Eclipse 4.2, Mac OS X 10.8 (ML), and Java 6
body: <p>I'm trying to run Eclipse 4.2 (latest from website: eclipse-SDK-4.2-macosx-cocoa-x86_64) on Mac OS X 10.8 (Mountain Lion).</p>
  
  <p>I have Java 7 installed, but I keep getting prompted to install Java 6. When I choose to forgo the install by clicking "Not Now", Eclipse exits.</p>
  
  <pre><code>$ java -version
  java version "1.7.0_05"
  Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
  Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)
  
  $ whereis java
  /usr/bin/java
  </code></pre>
  
  <p>Any ideas on how to get Eclipse to work with the latest version of Java? README is lacking any useful information (and even claims Eclipse was tested with Java 7 on some platforms).</p>
  
  <hr>
  
  <p>UPDATE:
  Running <code>sudo /Applications/.Eclipse/Eclipse.app/Contents/MacOS/eclipse</code> works fine. After running under sudo and then switching back to lowly me with <code>/Applications/.Eclipse/Eclipse.app/Contents/MacOS/eclipse</code> results in a lock file error (permission denied).</p>
  
  <p>It appears I have two problems:</p>
  
  <ul>
  <li><p>Running through icon click results in "Need Java 6"</p></li>
  <li><p>Running from command line results in "Permission Denied"</p></li>
  </ul>
  
  <hr>
  
  <p>UPDATE: It appears to be more junk from Cupertino:</p>
  
  <p>Apple Radar: 12082976</p>
  
  <p>Here's the text that Apple wants to hide from the world:</p>
  
  <p>I purchased a new Mac Book Pro. I immediately upgraded to Mountain Lion. I installed Java 7 from Sun [Oracle]:</p>
  
  <p>$ java -version
  java version "1.7.0_05"
  Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
  Java HotSpot(TM) 64-Bit Server VM (build 23.1-b03, mixed mode)</p>
  
  <p>$ whereis java
  /usr/bin/java</p>
  
  <p>$ /usr/libexec/java_home
  /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home</p>
  
  <p>When I attempt to run the Java Preferences (in /Applications/Utilities) and Eclipse, I get prompted to install Java (see attachment).</p>
  
  <p>This outdated article was no help (adding environment.plist): <a href="https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html" rel="nofollow noreferrer">https://developer.apple.com/library/mac/#documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html</a>. I thought the problem might be $JAVA_HOME was not set, but I was wrong.</p>
  
  <p>I think I got more useful information from Stack Overflow rather than the vendor (Apple), but its still not solved. <a href="https://apple.stackexchange.com/questions/58203/mountain-lion-with-java-7-only">https://apple.stackexchange.com/questions/58203/mountain-lion-with-java-7-only</a> and <a href="https://apple.stackexchange.com/questions/57986/multiple-java-versions-support-on-os-x-and-java-home-location">https://apple.stackexchange.com/questions/57986/multiple-java-versions-support-on-os-x-and-java-home-location</a>.</p>
  
  <p>Please fix this. I spends thousands on Apple hardware and hundreds on Apple software, and this sort of thing is not acceptable. I have personally wasted hours on this issue, as have others. How can the Apple QA department miss another gapping hole?</p>