简体   繁体   中英

Can't Install netbeans on Mac OS 10.7

Just got a brand new mac.

However when I try to install netbeans 7.0.1, I get to the part of the installation where it wants me to select a destination to install. But it says "Netbeans 7.0.1 cannot be installed on this disk. This software can be installed and work only with Java 6."

I have installed the new 10.7 JDK from apples developer website here:

http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/5.1.17.2.1.3.3.1.0.1.1.0.3.10.3.3.1

But I am still getting the message.

What am I missing here.

I had the same problem. Worse, I could not install the system JVM after installing the developer preview. After some digging, it seems the developer preview creates a broken symbolic link to CurrentJDK. To fix:

cd /System/Library/Frameworks/JavaVM.framework/Versions
rm CurrentJDK
sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents/Home CurrentJDK

This is partially the Netbeans installer's fault as well. It hasn't been updated yet to the newer JDK path style that Apple introduced a while ago (/Library/Java/JavaVirtualMachines).

Forgot to install java developer tools. The Java Developer Tools are available from the Apple developer downloads site, or Oracle.

OSX lion does not come with java developer toolkit pre-installed.

Tnx allot @jsravn for your solution . Still i wanted to add more info because I'm still on Snow leopard (latest is 10.6.8) but encountered this same problem.

Although Netbeans uses the default installer, their installation uses unpack200 a Java Command. This was causing the fatal error. I found this when looking at /var/log/install.log:

   [truncated]
   /System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/unpack200: No such file or directory 

The Solution is to symlink CurrentJDK to the newer JDK. (similar to @jsravn)

cd /System/Library/Frameworks/JavaVM.framework/Versions
mv CurrentJDK CurrentJDK_old
sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_27-b07-395.jdk/Contents CurrentJDK

But as you can read the error log the symlink should end in Contents

I believe this is introduced by the "Java 6 update" by Apple software updates. target versions are Mac OSX 10.6.* or greater

Note that it is odd that Apple did not update the symlink themselves. It may be wise to restore the CurrentJDK symlink afterwards.

There are related posts on that subject in StackOverflow and, as I'm facing the same issue, I guess that Netbeans is not finding JDK on your system (as well as on mine...)

As mentioned by many people JDK is no more part of OS X Lion, but has to be installed and there are 2 versions: one from developer site and one that is uploaded by "Mac update" when needed.

I had no trouble using Netbeans with the second one as it does not install in the same directories.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM