Tahmina Khatoon
Tahmina Khatoon

Reputation: 1091

How to solve error java.lang.NoClassDefFoundError at the time of installing netbeans8 in debian

I am trying to install netbeans 8 in debian-7.0-amd64-minimal. (VPS)

1st I have installed java/JDK latest version (1.8.0_20) by following https://www.digitalocean.com/community/tutorials/how-to-manually-install-oracle-java-on-a-debian-or-ubuntu-vps

Next I am trying to install netbeans by following

http://installnetbeansdebian.blogspot.com/2013/06/how-to-install-netbeans-73-ide-complete.html

when I run

./netbeans-8.0-php-linux.sh

it displays the following error.

Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...

Exception: java.lang.NoClassDefFoundError thrown from the UncaughtExceptionHandler in thread "main"

Anybody knows, how to fix this?

Upvotes: 6

Views: 25903

Answers (11)

rocojorge
rocojorge

Reputation: 1

I have the same issue and I use:

sudo bash -x Apache-NetBeans-12.1-bin-linux-x64.sh --silent

and with this I coud install netbeans, but the version 12.1.

Upvotes: 0

Evgeniy Baranov
Evgeniy Baranov

Reputation: 1

I had the same issue while installing Oracle Developer Studio via ssh X forwarding. I switched jdk from SE to 1.7.0 openjdk (update-alternatives --config java) and then managed to install. I hope it will help someone.

Upvotes: 0

nivas
nivas

Reputation: 1

The solution was to execute the NetBeans installer as a normal user, or any user other than root. define JAVA_HOME and JDK_HOME as environment variable

Upvotes: 0

The solution was to execute the NetBeans installer as a normal user, or as the same user that you're logged in as in the X session

Upvotes: 0

Ismail Ams
Ismail Ams

Reputation: 21

I had the same issue on "Fedora 26". But I resolved it by repeating the same procedure but not as 'root' or 'sudo'. I.e:

Change directory to locate the downloaded file. then.

$ chmod +x netbeans-8.2-linux.sh
$ ./netbeans-8.2-linux.sh

Upvotes: 2

Isaac Limón
Isaac Limón

Reputation: 2058

Maybe late. For ubuntu 17

azuka$ : xhost +
azuka$ : sudo su
root$ : sh netbeans-8.2-php-linux.sh

Upvotes: 2

swapnil
swapnil

Reputation: 9

Simply close netbean if you open it already 1.install openjdk 2. download netbean and where you download it use below command $./netbeans-8.2-javaee-linux.sh

Upvotes: 0

user7276829
user7276829

Reputation:

Just had the same issue here (Fedora 25, Netbeans 8.2). It only occurs, when executing the installer as root which seems to be a problem with a root-privileged gui in a non-root-privileged environment.

Solution: Either install netbeans as normal user in your home directory OR launch the installer as root with the switch '--silent':

./netbeans-8.2-html-linux-x64.sh --silent

which will install netbeans in /usr/local.

Upvotes: 6

monkey_white
monkey_white

Reputation: 91

Had a similar issue, for some reason the command

$ sudo chmod -x netbeans-8.2-javaee-linux.sh

didn't create executable file out of the script, so I had to use GUI method, as it shown here in the second answer:

https://askubuntu.com/questions/229589/how-to-make-a-file-e-g-a-sh-script-executable-so-it-can-be-run-from-termina

then as the user Firestorm suggested just dropped sudo and it worked for me:

$./netbeans-8.2-javaee-linux.sh

Installed perfectly even created "Development" department in the "Application" menu and nested program start tag there. Debian-8 x64 KDE

Upvotes: 9

Firestorm
Firestorm

Reputation: 157

This question is nearly exactly two years old, but still actually occurred here just now.

I had this too on a Slackware system. I was trying to install it like you (because Slackware doesn't provide NetBeans packages) and I was typing in a virtual terminal window after executing su. The problem was the exact same as yours: I got the NoClassDefFound exception and the installer stopped. The solution was to execute the NetBeans installer as a normal user, or as the same user that you're logged in as in the X session. Java errors can be a bit cryptical, but the solution's as easy as that.

I hope this helps.

Upvotes: 0

Onlyjob
Onlyjob

Reputation: 5888

It is much easier (and more reliable and more secure) to use package management system to install software. All you need to do is to use the following command to install netbeans on Debian:

sudo apt-get install netbeans

Although netbeans version 7 will be installed (ver. 8 is not available from native Debian repository yet) you won't be struggling to make it work.

Besides please be careful with instructions to install java/JDK -- the method they describe is not the best. If OpenJDK is not sufficient for you then you might be doing something wrong. If you absolutely have to try Oracle's Java (unfortunately there are some corner cases when it might be needed) please use java-package to build your own Java package (.deb) from downloadable Java binary.

Upvotes: -1

Related Questions