简体   繁体   中英

Netbeans is not getting installed in my Mac, it says JDK not found, though JDK is installed in the same

Error: Failure while executing the commands mentioned below:-

/usr/bin/sudo -E -- env LOGNAME=ajaygautam USER=ajaygautam USERNAME=ajaygautam /usr/sbin/installer -pkg /usr/local/Caskroom/netbeans/8.2/NetBeans\\ 8.2.pkg -target / exited with 1.

Here's the output: installer: Error - NetBeans IDE cannot be installed. Java (JRE) found on your computer but JDK 8 or newer is required. Please download and install the latest update of JDK 8 from http://www.oracle.com/technetwork/java/javase/downloads/index.html and restart NetBeans installation.

Would someone in tracing out the issue above? I'm not able to install NetBeans 8.2 package in my Mac.

I got the same problem and could to fix it with brew.

firstly install java JDK https://www.oracle.com/java/technologies/javase-downloads.html then run this in your terminal:

brew install netbeans

it will install the latest version of netbeans.

Download OpenJDK from Archived OpenJDK GA Releases .

This will give you a file such as openjdk-9.0.4_osx-x64_bin.tar . Extract the tar file and copy it to the correct place in your machine.

tar -xf openjdk-9.0.4_osx-x64_bin.tar
sudo cp -r jdk-12.0.2.jdk /Library/Java/JavaVirtualMachines/

Now you can run the Netbeans installer.

i just install using brew

brew install netbeans

and now i can use the latest 12.4

The following steps are used to install NetBeans on MacOS :-

1) Download the Latest version

In order to install NetBeans on MacOS, we have to download the latest version of NetBeans by visiting its official website Ie https://netbeans.org/downloads/

2) Mount the disk image file

The dmg file which is downloaded from the official website of NetBeans is to be mounted to an installer. This can be done with the following command:

$ hdiutil mount Downloads/netbeans-8.2-macosx.dmg

3) Install the file

The file is mounted to the volumes directory which contains a package file (.pkg) which is installable by using the installer command. The command needs superuser privileges for which, sudo is used.

$ sudo installer -pkg Volumes/ NetBeans\\ 8.2/NetBeans\\ 8.2.pkg -target /

The file will be installed to the target root which is mentioned while installing the file.

4) Unmount the file

After the completion of installation process, we need to unmount the installer. This can be done by using the option Unmount with hdiutil command.

$ hdiutil unmount /Volumes/NetBeans\\ 8.2

Well, we have done with the installation process of NetBeans 8.2 on MacOS.

Actually, java_home is in

/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java_home

but in my case, java_home was in the next location ie

/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home 
  • I deleted my java_home from /usr/libexec/java_home by root user

  • added new java_home in /usr/libexec by following command

     sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home /usr/libexec/.

For some reason, some Netbeans versions for Mac OS do not detect the JDK contained in JRE. For proper installation and running the application, you must have Java for Mac OS installed previously. https://www.java.com/es/download/

Install The Lates Version ONLY which is 12.1 as of now!

https://netbeans.apache.org/download/nb121/nb121.html

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