Clairexxp
Clairexxp

Reputation: 163

How to fix error while installing NetBeans?

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

Upvotes: 16

Views: 26849

Answers (10)

Bob D
Bob D

Reputation: 1

You can't add a new tire to your car tire rim until you remove the old tire first!

I found that having a previous older version of NB installed causes the no-install/boo-boo error message. Thus no new install/overlay/overwrites.

Simply use Synaptic or command line method to uninstall the old NB version first, then install the newer NB version.

Keep in mind you are only uninstalling the old NB. It does not uninstall all your projects and your work. Those configs, files, and directories still remain intact and safe. Which "Ennnha" might be a good thing!

I honestly do not think NB has ever had a tech magic feature within any version (as if to simply upgrade). Only a new/virgin fresh install. It seems a prudent cleaner conceptual thing to do with a newer version of anything. Helps prevent any potential file corruption.

In short/restated/repeated: the error/no install seems to be the older version is still installed and that causes the "fail" boo-boo message. It's attempting to install the newer tire over the top of the old tire.

It does not (auto-magically) uninstall the old and replace it with the new.

Yeah. I get it! You worry you'll lose all your old NB setup/settings, look-n-feel, project directory links, etc. I don't think you'll lose that much! Just your NB IDE "Look and feel and any customization"!

Each project has its own config inside the dir where the project exist. How hard is it to re-add the already existing NB projects config back to the new NB IDE menu listing? EACH Project config remains and set for EACH individual project you previously created. So that alone is (auto-magic) import re-used when "re-connect" set the path to each project correctly.

You ARE NOT setting up "A new project"! The old project config already exist, it is still there and set up. So DO NOT attempt the new-project option unless it auto-links and magically fills in the blanks.

Import the old config into the new NB. Hint= (File-Project Properties) and find your old project locations for each Project. Perhaps even (Open Project) will work and auto-magically pull it all the config info in and add it to the list.

By the way, those who know usually have a local and a root backup safeguard of each Project. So don't confuse your local as the project just because you happened to name the dir "Projects". (NB uses a Special NB project-Config FILE) and it's probably the other one (dir) if it does not auto-fill in the blanks when selected... the heavens above may or may not break into song!

Upvotes: 0

NINAD RAJE
NINAD RAJE

Reputation: 1

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

Upvotes: 0

Arjun Singh
Arjun Singh

Reputation: 31

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

Upvotes: 0

John Breland
John Breland

Reputation: 51

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.

Upvotes: 0

Nite
Nite

Reputation: 21

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.

Upvotes: 2

Andy
Andy

Reputation: 41

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"

Upvotes: 4

Felistrix
Felistrix

Reputation: 123

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.

Upvotes: 9

Chili
Chili

Reputation: 21

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)

Upvotes: 2

user13122936
user13122936

Reputation: 31

The https://netbeans.apache.org/download/nb113/nb113.html site now has this memo:

The installers will not run under JDK 14 because usage is made of the Pack200 Tools and API, for packing and unpacking, which is removed in JDK 14, see JEP 367.

Upvotes: 3

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.

Upvotes: 15

Related Questions