2

I installed Java NetBeans IDE 12.0 and JDk-16. When I try to create a project using Java With Ant, it get stuck like in the screenshot. When I cancel it, it creates the file but no code in it i.e., no main method is created. Just a blank file.

Does anyone know how to solve this?

enter image description here

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Abdurahman
  • 21
  • 1
  • 3

4 Answers4

0

From the NetBeans documentation for "Deployment Platforms" for NetBeans 12.0:

Apache NetBeans 12.0 runs on the JDK LTS releases 8 and 11, as well as on JDK 14, i.e., the current JDK release at the time of this NetBeans release.

NetBeans may work (or appear to work) with newer JDK releases that are not officially supported such as JDK 16, but you run the risk of hitting unexpected problems.

So if you don't need any Java features released after JDK 14, download and install JDK 14, and add it as a Java platform in NetBeans, using Tools > Java Platforms > Add Platform.... You don't need to uninstall JDK 16.

However, if you really need JDK 16 features then use a different IDE. The latest release of Eclipse, 2021-03, explicitly supports JDK 16.

skomisa
  • 16,436
  • 7
  • 61
  • 102
0

I had the same problem and was able to solve it in windows by following the steps below:

  1. Uninstall Netbeans 12.4. Make sure to delete all the cache files (Drive:\users\user\AppData\Roaming\Netbeans and Drive:\users\user\AppData\Local\Netbeans) (Windows)
  2. Check your JDK 16 directory (no JRE) and environment variables JAVA_HOME, CLASSPATH and PATH.
  3. Install Netbeans 12.4
  4. Create new project and check that you select Download and activate nb-javac.
Álvaro Loza
  • 411
  • 4
  • 21
0

For me it helped using NetBeans version 12.5 and the JDK 14. After that everything was running smooth.

BEN_BINARY
  • 29
  • 4
0

I had the same problem and upgrading to version 12.5 worked for me.