big sur java home,在MacOS Big Sur上安装Netbeans 8.2找不到JDK

I have recently upgraded into MacOS Big Sur and when tried to open NetBeans 8.2 it gave an error

The JDK is missing and is required to run some NetBeans modules. Please use the --JDK home command-line option to specify a JDK installation

I tried setting JAVA_HOME to the JDK path but it didn't work. So, I uninstalled Netbeans and JDK and re-downloaded Netbeans 8.2 and JDK 8.

Now when trying to set up the Netbeans, it shows :

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.

Java -version

java version "1.8.0_271"

Java(TM) SE Runtime Environment (build 1.8.0_271-b09)

Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

Javac -version

javac 1.8.0_271

My current $JAVA_HOME is set to/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home

I also tried installing NetBeans 11 and 12 with JDK 14 and 15 but it gives the same error

EDIT:

Following is the only solution that worked for me.

/Applications/NetBeans/Apache\ NetBeans\ 12.1.app/Contents/Resources/NetBeans/netbeans/bin/netbeans --jdkhome /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home

Paste the above command on terminal. It opens the NetBeans. To use the NetBeans without typing the command again save the above command on a code editor and save as NetBeans.command file.

Then open the file. Click okay on the prompted message. Type following command on the terminal.

sudo passwd root

Type your login password.

Just press Enter (you don't have to type a new password)

Type su root and your login password again.

Type chmod +x . Quit the terminal and open the saved file. It should work now.

解决方案

I had the same problem.

I have not needed to restart the computer.

I have simply changed the line:

netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home"

in the file netbeans.conf, from the directory:

/Applications/NetBeans/NetBeans\ 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf

and this has worked for me

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值