简体   繁体   English

在 NetBeans 12.0 中,我收到错误无法访问 java.lang

[英]In NetBeans 12.0 I get the error cannot access java.lang

I know there are very many questions exactly like this, but I have tried various things and still have no idea what to do.我知道有很多这样的问题,但我尝试了各种方法,但仍然不知道该怎么做。 I started learning java very recently and was just able to print "hello world" with a .java file using a text editor.我最近开始学习 Java,并且能够使用文本编辑器使用 .java 文件打印“hello world”。 That was when I decided to get an IDE and I downloaded NetBeans 12.0.那时我决定购买 IDE,并下载了 NetBeans 12.0。 Once netbeans was ready, I clicked "new project" and chose "Java with Maven" and "Java application". netbeans 准备就绪后,我单击“新项目”并选择“Java with Maven”和“Java 应用程序”。 Once I finished setting up the project, I right clicked the package and made a new main class.完成项目设置后,我右键单击该包并创建了一个新的主类。 However, next to "package com.mycompany.qwerty" in the file there was a red exclamation mark symbol where it shows the line numbers.但是,在文件中的“package com.mycompany.qwerty”旁边有一个红色感叹号符号,它显示了行号。 When I put my mouse over it, it said "Cannot access java.lang Fatal error: unable to find package in classpath or bootclasspath".当我将鼠标放在它上面时,它说“无法访问 java.lang 致命错误:无法在类路径或引导类路径中找到包”。 I have absolutely no idea how to fix this since I have never used NetBeans before.我完全不知道如何解决这个问题,因为我以前从未使用过 NetBeans。 I have tried reinstalling netbeans several times and the same thing occurs.我曾多次尝试重新安装 netbeans,但发生了同样的事情。 I have jdk 11.0.8 as well.我也有 jdk 11.0.8。 How would I resolve this issue?我将如何解决这个问题?

After reading sorifiend's comment, I looked up how to change the file path for jdk.在阅读了 sorifiend 的评论后,我查找了如何更改 jdk 的文件路径。 In a file called netbeans.conf the variable called netbeans_jdkhome was just /usr or something and I changed it to /usr/lib/jvm/java-1.11.0-openjdk-amd64 (I have linux) and then the problem was completely fixed.在名为 netbeans.conf 的文件中,名为 netbeans_jdkhome 的变量只是 /usr 之类的,我将其更改为 /usr/lib/jvm/java-1.11.0-openjdk-amd64(我有 linux),然后问题就完全解决了.

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

相关问题 “无法访问java.lang”-Netbeans 6.9.1中的错误 - “cannot access java.lang” - Error in Netbeans 6.9.1 Netbeans IDE 11 无法访问 java.lang 致命错误:无法在类路径或引导类路径中找到包 java.lang - Netbeans IDE 11 cannot access java.lang Fatal Error: Unable to find package java.lang in classpath or bootclasspath Ubuntu 18.04 上的 Netbeans 11.2 - 无法访问 java.lang 致命错误:无法在类路径或引导类路径中找到包 java.lang - Netbeans 11.2 on Ubuntu 18.04 - cannot access java.lang Fatal Error: Unable to find package java.lang in classpath or bootclasspath NetBeans清理和构建Android错误:Java.Lang X500Principal访问 - NetBeans Clean & Build Android error: Java.Lang X500Principal access Java.lang错误? - Java.lang Error? 我收到错误 Java.lang 字符串无法转换为学生? - I am getting a error Java.lang string cannot be converted to student? 如何使用 Gmail 发送带有 R 的 email,当我收到此 Z93F725A07B333FE1C889F22Z 错误时。 - How do I send an email with R using a Gmail, when I get this java.lang error 错误给出java.lang Null PointerException - Error gives java.lang Null PointerException netbeans无法找到java.lang没有jdk9 - netbeans unable to find java.lang no jdk9 JSONException:值 - JSONException: Value <!DOCTYPE of type java.lang cannot be converted to JSONObject
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM