How to fix error while installing NetBeans?

Viewed 20898

I have installed Java and am trying to install NetBeans 11.3 on my Windows 10 but after I ran the exe. installer, an error message popped up:

An unexpected exception happened in thread main java.lang.NoClassDefFoundError java/util/jar/Pack200

9 Answers

NetBeans have problems with the jdk-14, because I suppose that you have install the jdk-14 so uninstall it and try it with the jdk-13.0.2.

Sorry, but in my opinion is to install an old version from Java no solution, just because it works. When someone has problems with his Firewall, simply disable the Firewall would also be no solution.

https://www.java.com/en/download/faq/other_jreversions.xml
We highly recommend users remove all older versions of Java from your system. Keeping old and unsupported versions of Java on your system presents a serious security risk. Removing older versions of Java from your system ensures that Java applications will run with the most up-to-date security and performance improvements on your system.

The "real" solution would be a reprogramming of the NetBeans installer. This used function was suggested for deprecated on 2018-04-04, which was done on 2018-08-23.
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8200752
The removal was suggested on 2019-10-08, which was done on 2019-12-18.
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8232022

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8232022
We assume that developers who rely on Pack200 have had enough notice about its proposed removal to make alternative arrangements. … We assume that developers who use pack200 to shrink application JARs can switch to either the jlink tool or the jpackage tool to create application-specific runtimes with an optimized form factor.

edit: I solved it this way.

  1. uninstalled JDK 14
  2. installed JDK 13.0.2
  3. installed Apache NetBeans
  4. installed JDK 14
  5. open C:\Program Files\NetBeans\netbeans\etc\netbeans.conf and changed path to JDK
  6. uninstalled JDK 13.0.2

Now NetBeans runs with the JDK 14.

Yes, I got it working as follows from cmd, when referring to older version: Apache-NetBeans-11.3-bin-windows-x64.exe --javahome "C:\Program Files\Java\jdk-12.0.2"

If several JDK versions are installed, then you need to define the environment variable "JAVA_HOME" where to set the path to JDK-12. Details are described here. (Only in Russian)

An alternate way to Andy's.
(Windows)
1) Right click on "Apache-NetBeans-11.3-bin-windows-x64" installer and select "Create shortcut".
2) Right click on the created shortcut and select "Properties".
3) In the "target" textbox, add your under 14 JDK version path at the end, here is how mine looks like:

C:\Users\userfoldername\Desktop\Apache-NetBeans-11.3-bin-windows-x64.exe --javahome "C:\Program Files\Java\jdk-13"

4) Press Ok when done, double-click on the shortcut and it should install fine now.

Switching to openJDK 12 worked for me too. But instead of uninstalling JDKs or manually changing the env, I use Sdkman.io which works like Node version manager if you have used that. It manages your JDKS for you and offers downloads of different versions (Open, Zulu, Graals) and will switch between them with with just a quick command.

I found a nice solution in 3 steps:

  1. check all versions of the JDK path in Environment variables, if there is an outdated path please remove it and keep the latest version of the Java JDK bin path.
  2. after the second step, please uninstall the Netbeans and re-install the latest version.
  3. Netbeans will found the latest JDK path in case it was jdk14 and choose JDK latest version path for NetBeans. solved

Just install JRE from oracle. Everthing will run fine. I have the same issue

Related