0

This question already has an answer here:

I have a brand new Ubuntu 18.10 VM (hosted on Windows 10), built from an osboxes.org image. Aside from totally unrelated minor stuff, all I've done on this virgin OS is:

sudo apt install git
sudo apt install ant
sudo apt install netbeans

but then when I tried to run netbeans, the command was not found. I had been away from my desk after the install, so I ran sudo apt install netbeans a second time. After that, netbeans command is found, and a NetBeansIDE splash window shows for a while, but then it goes away.

Now I look at ~/.netbeans/var/log/messages.log and see a java.lang.NoClassDefFoundError.

In detail, it appears that java was already installed in the VM image from osboxes. java -version reports version 11.0.1 2018-10-16.

Having seen other posts, I did a sudo apt-get remove netbeans as well as sudo apt-get purge netbeans and then sudo apt-get install netbeans. This didn't help.

In further detail, it appears that the version of NetBeans being installed is 8.1. The content of messages.log is below:

  Log Session: Friday, November 16, 2018 10:31:23 AM EST
  System Info: 
  Product Version         = NetBeans IDE 8.1 (Build 20180424-debian-8.1)
  Operating System        = Linux version 4.18.0-11-generic running on amd64
  Java; VM; Vendor        = 1.8.0_181; OpenJDK 64-Bit Server VM 25.181-b13; Oracle Corporation
  Runtime                 = OpenJDK Runtime Environment 1.8.0_181-8u181-b13-1ubuntu0.18.10.1-b13
  Java Home               = /usr/lib/jvm/java-8-openjdk-amd64/jre
  System Locale; Encoding = en_US (nb); UTF-8
  Home Directory          = /home/helmut
  Current Directory       = /home/helmut
  User Directory          = /home/helmut/.netbeans/8.1
  Cache Directory         = /home/helmut/.cache/netbeans/8.1
  Installation            = /usr/share/netbeans/8.1/nb
                            /usr/share/netbeans/8.1/ide
                            /usr/share/netbeans/8.1/java
                            /usr/share/netbeans/8.1/apisupport
                            /usr/share/netbeans/8.1/harness
                            /usr/share/netbeans/8.1/platform
  Boot & Ext. Classpath   = /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/classes:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jaccess.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/dnsns.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunec.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/java-atk-wrapper.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/nashorn.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/icedtea-sound.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/sunpkcs11.jar
  Application Classpath   = /usr/share/java/jcodings.jar:/usr/share/netbeans/8.1/platform/lib/boot.jar:/usr/share/netbeans/8.1/platform/lib/org-openide-modules.jar:/usr/share/netbeans/8.1/platform/lib/org-openide-util.jar:/usr/share/netbeans/8.1/platform/lib/org-openide-util-lookup.jar:/usr/share/netbeans/8.1/platform/lib/org-openide-util-ui.jar:/usr/lib/jvm/java-8-openjdk-amd64/lib/dt.jar:/usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar
  Startup Classpath       = /usr/share/netbeans/8.1/platform/core/org-openide-filesystems-compat8.jar:/usr/share/netbeans/8.1/platform/core/core-base.jar:/usr/share/netbeans/8.1/platform/core/asm-all-5.0.1.jar:/usr/share/netbeans/8.1/platform/core/core.jar:/usr/share/netbeans/8.1/platform/core/org-openide-filesystems.jar:/usr/share/netbeans/8.1/platform/core/org-netbeans-libs-asm.jar:/usr/share/netbeans/8.1/nb/core/org-netbeans-upgrader.jar:/usr/share/netbeans/8.1/nb/core/locale/core_nb.jar

java.lang.NoClassDefFoundError: org/eclipse/osgi/baseadaptor/HookConfigurator while loading org.netbeans.modules.netbinox.NetbinoxHooks; see http://wiki.netbeans.org/DevFaqTroubleshootClassNotFound
    at org.netbeans.ProxyClassLoader.selfLoadClass(Unknown Source)
    at org.netbeans.ProxyClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at org.netbeans.modules.netbinox.NetbinoxFactory.newFramework(Unknown Source)
    at org.netbeans.core.netigso.Netigso.prepare(Unknown Source)
    at org.netbeans.NetigsoHandle.turnOn(Unknown Source)
    at org.netbeans.ModuleManager.enable(Unknown Source)
INFO [null]: Last record repeated again.
    at org.netbeans.core.startup.ModuleList.installNew(Unknown Source)
    at org.netbeans.core.startup.ModuleList.trigger(Unknown Source)
    at org.netbeans.core.startup.ModuleSystem.restore(Unknown Source)
    at org.netbeans.core.startup.Main.getModuleSystem(Unknown Source)
INFO [null]: Last record repeated again.
    at org.netbeans.core.startup.Main.start(Unknown Source)
    at org.netbeans.core.startup.TopThreadGroup.run(Unknown Source)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/osgi/baseadaptor/HookConfigurator
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at org.netbeans.JarClassLoader.doLoadClass(Unknown Source)
    ... 16 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.osgi.baseadaptor.HookConfigurator starting from ModuleCL@459c3d83[org.netbeans.modules.netbinox] with possible defining loaders [ModuleCL@459c3d83[org.netbeans.modules.netbinox]] and declared parents [org.netbeans.MainImpl$BootClassLoader@41629346, ModuleCL@7636aab3[org.netbeans.core.netigso], ModuleCL@629a3076[org.netbeans.libs.osgi]]
    at org.netbeans.ProxyClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 19 more

marked as duplicate by mikewhatever, George Udosen, MadMike, Eric Carvalho, abu_bua Nov 25 '18 at 15:37

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Sadly, Netbeans in official PPA does not start as expected on fresh Ubuntu 18.xx, because of Java dependecies.

So here is alternative solution:

Remove Java 11 (which is not compatible with Netbeans 8.2 on Ubuntu 18.xx):

sudo apt remove netbeans
sudo apt remove openjdk-11-*

Install Java 8 and Netbeans 8.2 (Netbeans is about 214MB):

sudo apt install openjdk-8-jdk

wget https://download.netbeans.org/netbeans/8.2/final/bundles/netbeans-8.2-linux.sh

sudo sh netbeans-8.2-linux.sh

When it asks about Java Location select /usr/lib/jvm/java-8-openjdk-amd64.

After installation you can access it via

/usr/local/netbeans-8.2/bin/netbeans

if you chose default location.

  • Let me know if anything goes wrong... – Olimjon Nov 17 '18 at 9:52
  • Thanks. That got me further, Olimjon. Now netbeans runs but I can't create a new project. Specifically, If I do File / New Project, and then choose java / java Application, then the description at bottom mentions "This feature is not yet enabled. Press Next to activate it." When I press next, It does "Finding Feature" and says "Not all requested modules can be enabled." NOTE that the netbeans-8.2.linux.sh did NOT ask me about the Java location. This could be the reason. Note I'm trying askubuntu.com/questions/750514/… right now – Dr.Lightning Nov 18 '18 at 14:06
  • The 750514 link above worked, so now I can add a new project. – Dr.Lightning Nov 18 '18 at 14:18
  • @Dr.Lightning, OK. Glad that it worked. – Olimjon Nov 19 '18 at 2:37
  • @Dr.Lightning, OK, I am interested. I will contact you... – Olimjon Nov 21 '18 at 18:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.