NetBeans在MacOS Big Sur上无法安装。

huangapple go评论81阅读模式
英文:

Netbeans does not install on MacOS Big Sur

问题

我已在我的MacBook Air上安装了Big Sur。已安装了Java,但Netbeans安装时显示未找到Java JDK。有人解决了这个问题吗?

英文:

I have installed Big Sur on my MacBook Air. Java is installed but Netbeans install says no Java JDK found. Did anybody has the solution for this issue?

答案1

得分: 4

这是我解决的方法。从命令行中运行:

/usr/libexec/java_home -V

这将输出您已安装的Java虚拟机:

匹配的Java虚拟机(4):
    14.0.1(x86_64)"UNDEFINED" - "OpenJDK 14.0.1" /usr/local/Cellar/openjdk/14.0.1/libexec/openjdk.jdk/Contents/Home
    1.8.271.09(x86_64)"Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    1.8.0_271(x86_64)"Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
    1.8.0_251(x86_64)"Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home

如果您没有看到JDK 1.8,那么您应该前往Oracle.com并安装它。假设您安装了1.8版本,您应该使用以下命令将其设置为您的JAVA_HOME

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home"

注意,您的位置可能与我的稍有不同,您应该使用在运行/usr/libexec/java_home -V时在虚拟机列表中出现的1.8的位置。我还建议您将此添加到您的shell配置文件中,以便在下次打开shell时设置当前的JAVA_HOME。我使用的是ZSH作为我的shell,所以命令是:

echo 'export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home"' >> ~/.zshrc

现在您几乎完成了。只需确保您安装了Homebrew,然后运行brew cask install netbeans

这样您就可以无问题地安装它,并将其放置在您的应用程序文件夹中。

英文:

Here's how I resolved it. From the command line, I ran:

/usr/libexec/java_home -V

This will output the Java VMs you have installed:

Matching Java Virtual Machines (4):
    14.0.1 (x86_64) "UNDEFINED" - "OpenJDK 14.0.1" /usr/local/Cellar/openjdk/14.0.1/libexec/openjdk.jdk/Contents/Home
    1.8.271.09 (x86_64) "Oracle Corporation" - "Java" /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
    1.8.0_271 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home
    1.8.0_251 (x86_64) "Oracle Corporation" - "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_251.jdk/Contents/Home

If you don't see JDK 1.8, then you should go to Oracle.com and install it. Assuming you have 1.8, you should set that as your JAVA_HOME with the following command:

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home"

Note that your location may be slightly different from mine, you should use the location for 1.8 that was present in your list of VMs when you ran /usr/libexec/java_home -V, above. I would also recommend you add this to your shell profile so that the current JAVA_HOME is set the next time you reopen your shell. I'm using ZSH as my shell, so the command was:

echo 'export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home"' >> ~/.zshrc

Now you're almost home. Just make sure you have Homebrew and then run brew cask install netbeans.

That should enable you to install it without issue and will place it in your Applications folder.

答案2

得分: 4

我通过安装JDK15和Apache Netbeans 12.2(仅限12.2版本)来解决了这个问题。它运行良好。

英文:

I solved it by installing JDK15 and Apache Netbeans 12.2 (Only 12.2).

It works well.

答案3

得分: 2

我是ChatGPT,一个基于GPT-3.5架构的语言模型。由于您要求只返回翻译的部分,我将为您提供已翻译的文本,不包含其他内容:

我解决了我的问题,方法如下,而且取得了很好的效果:

问题:
当我通过命令行以详细模式执行Netbeans时,我看到了以下错误:

./netbeans -v
操作无法完成。无法找到支持(null)的Java运行时。
请访问http://www.java.com以获取有关安装Java的信息。

解决方案:
编辑netbeans.conf文件:

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

查找netbeans_jdkhome变量,取消注释并适当替换它。在我的情况下,设置如下:

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

完成上述步骤后,您可以使用Netbeans快捷方式或通过命令行正常启动Netbeans。

英文:

I resolved my problem like this and it worked out wonderfully:

<strong>Issue:</strong><br/>
When I executed Netbeans through command line in verbose mode, I saw the following error
<i>
./netbeans -v<br/>
The operation couldn’t be completed. Unable to locate a Java Runtime that supports (null).
Please visit http://www.java.com for information on installing Java.
</i>

<strong>Solution:</strong><br/>
Edit netbeans.conf file<br/>
<i>vi /Applications/NetBeans/NetBeans\ 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf</i><br/>
Look for netbeans_jdkhome variable, uncomment it and substitute it appropriately. In my case the setting was:<br/>
<i>netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home"</i><br>

Once you have done that, you can start Netbeans normally using the Netbeans shortcut or by using the command line.

答案4

得分: 1

同样,在这里,这是因为Big Sur更新已经擦除了$JAVA_HOME。回显$JAVA_HOME为空,你不能重定向到.bash_profile。也许Big Sur的更新会修复这个问题。我正在等待/搜索答案。暂时还不打算降级到Catalina。

英文:

Same here , it is because Big Sur update have erased $JAVA_HOME. echo $JAVA_HOME is empty and you cannot redirect to .bash_profile . Maybe Big Sur updates will fix this. I am waiting/searching for an answer myself. Not about to downgrade to Catalina just yet

huangapple
  • 本文由 发表于 2020年8月15日 18:10:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/63424844.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定