在MacOS Big Sur上安装Netbeans 8.2找不到JDK [英] Installing Netbeans 8.2 on MacOS Big Sur no JDK found

查看:218
本文介绍了在MacOS Big Sur上安装Netbeans 8.2找不到JDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近已升级到MacOS Big Sur,尝试打开NetBeans 8.2时出现错误

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

缺少JDK,并且它是运行某些NetBeans模块所必需的.请使用--JDK home命令行选项指定JDK安装

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

我尝试将JAVA_HOME设置为JDK路径,但是它不起作用.因此,我卸载了Netbeans和JDK,然后重新下载了Netbeans 8.2和JDK 8.

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.

现在,当尝试设置Netbeans时,它显示:

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

无法安装NetBeans IDE.您的计算机上找到了Java(JRE),但需要JDK 8或更高版本.请从 http://www下载并安装JDK 8的最新更新..oracle.com/technetwork/java/javase/downloads/index.html 并重新启动NetBeans安装.

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

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 -version

javac 1.8.0_271

我当前的 $ JAVA_HOME 设置为/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home

我还尝试使用JDK 14和15安装NetBeans 11和12,但是它给出了相同的错误

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

以下是唯一对我有用的解决方案.

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

  1. 将上述命令粘贴到终端上.它将打开NetBeans.要使用NetBeans而不再次输入命令,请将上面的命令保存在代码编辑器中,并另存为 NetBeans.command 文件.

然后打开文件.在提示的消息上单击确定".在终端上键入以下命令.

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

sudo passwd root

输入您的登录密码.

只需按 Enter (您无需输入新密码)

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

再次输入 su root 和您的登录密码.

Type su root and your login password again.

键入 chmod + x<使用.command> 保存的文件的路径.退出终端并打开保存的文件.现在应该可以使用了.

Type chmod +x <path of the file you saved with .command>. 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"

netbeans.conf文件中的目录:

in the file netbeans.conf, from the directory:

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

这对我有用

这篇关于在MacOS Big Sur上安装Netbeans 8.2找不到JDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆