简体   繁体   English

NetBeans 无法识别 JDK

[英]NetBeans doesn't recognise JDK

I am new to using NetBeans (got it this afternoon), and it won't let me build my project.我刚开始使用 NetBeans(今天下午拿到了),它不会让我构建我的项目。

I wrote some code, and the first line ( package io.github.kettle3d.Launcher; ) has an error saying the following:我写了一些代码,第一行( package io.github.kettle3d.Launcher; )有一个错误,说明如下:

cannot access java.lang
 Fatal Error: Unable to find package java.lang in classpath or bootclasspath

I'm using NetBeans version 12, with OpenJDK 12 (I don't have a Java account and honestly don't want Oracle getting all my personal info), both of them I installed today.我正在使用 NetBeans 版本 12 和 OpenJDK 12(我没有 Java 帐户,老实说不希望 Oracle 获取我所有的个人信息),我今天安装了这两个版本。
I have no idea what's going on.我不知道是怎么回事。 Could someone please give me a pointer?有人可以给我一个指针吗?

Okay, so I found out the issue was because NetBeans's JDK search path was set to /usr for some reason, but I changed it to where I installed JDK.好的,所以我发现问题是因为 NetBeans 的 JDK 搜索路径出于某种原因设置为 /usr,但我将其更改为安装 JDK 的位置。 The config file was (in my case, it'll be different depending on where you installed NetBeans) in /home/kettle/Beans of Net/netbeans/etc/netbeans.conf.配置文件是(在我的情况下,它会根据您安装 NetBeans 的位置而不同)在 Net/netbeans/etc/netbeans.conf 的 /home/kettle/Beans 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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