After installing JDK 11, I installed Netbeans from the repository. After all the processes, I finally installed successfully but when I created a simple program or opened the sample programs in this software, but there are many failures here.

Example: When I created a new java program,failures are:

cannot access java.lang fatal error unable to find package java.lang in classpath or bootclasspath 

in the line shows the package's name and

cannot find symbol class String

picture1 picture2

I think there is something wrong in the installation. How do I solve the issue?


1 Answer 1


Check that the java platform was correctly configured when you installed Netbeans.

In my case, during the installation process, there was a box for entering the path to the Java SDK, which defaulted to /usr (which is probably wrong). I failed to check that, and ended up having a wrongly configured JDK.

You can check this by going to Tools > Java Platforms in Netbeans. If the JDK platform says something like "Error: the specified folder does not contain a Java platform" then that's your problem.

In order to fix this you can either reinstall netbeans (and pick the correct path this time)


Edit the config file (exit netbeans first), in my case:

nano ~/netbeans-11.2/netbeans/etc/netbeans.conf

find the line with netbeans_jdkhome= and edit the path. Example:


save the file, and start Netbeans. With luck, it should work now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .