0

After I install Netbeans and create empty project I got this error : Unable to find package java.lang in class path or boot class path

I search on the Internet and answer was change JDK from config file . I did it but it's not working for me. also I reinstall netbeans but It doesn't work
I think problem is in class path but I don't know how set class path in netbeans .

Is there anyone with this problem before? thanks for attention and help

enter image description here

Image of Help > About netbeans
enter image description here

and also image of config file
enter image description here

Sina Soheili
  • 121
  • 1
  • 1
  • 11
  • 1
    Install a version of the JDK supported by the version of Netbeans you are using. You haven't told us which version you are using of anything. – Elliott Frisch May 26 '21 at 02:49
  • Thanks dear @ElliottFrisch . I edited question – Sina Soheili May 26 '21 at 02:55
  • 1
    ["Key to NetBeans 10 is enhanced support for Java Development Kit (JDK) 11"](https://www.infoworld.com/article/3330939/netbeans-10-adds-support-for-latest-java-and-php.html) - downgrade to Java 11. It does not support Java 16. – Elliott Frisch May 26 '21 at 03:12
  • I downgrade to Java: 11.0.11 but problem didn't solve . @ElliottFrisch – Sina Soheili May 26 '21 at 05:22
  • Look [here](https://stackoverflow.com/a/59850984/421195) – paulsm4 May 26 '21 at 05:34
  • @paulsm4 OP states in the question that this is already being done: _"answer was change JDK from config file . I did it but it's not working for me"_. – skomisa May 26 '21 at 18:49
  • @SINA Update your question to show your assignment of `netbeans_jdkhome` in **netbeans.conf**. Are you certain that the path you provided is correct? Is it possible that your project is still configured to use JDK 16? – skomisa May 26 '21 at 18:51
  • 1
    @SINA A screen shot of **Help > About** would also be helpful to show exactly what your environment looks like. – skomisa May 26 '21 at 18:53
  • @SINA Where is your source file located? – asbachb May 27 '21 at 01:26
  • thanks @paulsm4 . I read it before but it doesn't work – Sina Soheili May 27 '21 at 12:36
  • Thanks @skomisa. I added "About" content to question before but I will add image of that – Sina Soheili May 27 '21 at 12:42
  • @asbachb this is empty project and located in my desktop directory . /home/sina/Desktop/project – Sina Soheili May 27 '21 at 12:48
  • 1
    @SINA The information you originally presented showed that you were incorrectly using Java 16, but now your updated configuration looks good. But perhaps that specific project is still configured to use JDK 16? Try creating a second new project, to see if the issue is now resolved. – skomisa May 27 '21 at 16:57
  • Thanks @skomisa . As you said I forgot remove previous information so I updated question and and remove them. – Sina Soheili May 28 '21 at 05:16
  • @SINA with "source file" I meant your `JavaApplication13.java` file. You need to ensure that it's placed in the correct package. I slightly remember that I had some similar issue when a package was defined, but the class was placed in default package. But I'm not 100% certain. – asbachb May 28 '21 at 07:16
  • @asbachb I checked package again and it was correct. – Sina Soheili May 28 '21 at 13:10

0 Answers0