Ubuntu 18.04/Netbeans 10.0 Fatal Error: Unable to find package java.lang in classpath or bootclasspath

戏子无情 提交于 2019-12-11 15:26:22

问题


First, I work on Ubuntu 18.04 with netbeans 10.0 and open JDK 11. When I create a basic new project, alerts directly triggered.

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

I tried to uninstall/install netbeans and openJKD 11 but nothing work.

I looked on lots of forums discussions with this kind of problem but nothing work. For information,

xxx:~$java -version

gives

openjdk version "11.0.3" 2019-04-16
OpenJDK Runtime Environment (build 11.0.3+7-Ubuntu-1ubuntu218.04.1)
OpenJDK 64-Bit Server VM (build 11.0.3+7-Ubuntu-1ubuntu218.04.1, mixed mode, sharing)

i don't know what i'm missing, if someone can help me...


回答1:


You have NetBeans 10 version, but your JDK is version 11. So try use NetBeans 11 version... or download/install JDK 10 (the same as NetBeans).




回答2:


Configure the platform, it seems that installers for Ubuntu 18.04 missed the path to Java platform JDK11.

Add a new definition pointing to the right folders.

Platform Name: JDK 11 Platform Folder: /usr/lib/jvm/default-java

Then check the Sources/Source/Binary Format that must be configured to 11.



来源:https://stackoverflow.com/questions/56952163/ubuntu-18-04-netbeans-10-0-fatal-error-unable-to-find-package-java-lang-in-clas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!