I never used Ubuntu in my life before, and now I've installed Ubuntu 18.04 lts. I have problem with NetBeans. Although I have JDK and the rest that needs, I get this:
I can't open or start a project,nothing happens when I click. What should I do to fix this?
11 Answer
Installing Netbeans 9.0:
Building from Source:
Download the source zip from here and extract. Or open terminal and clone the repositories from GitHub using
git cloneInstall either Oracle JDK or OpenJDK.
For Oracle JDK: Download JDK8 from here and run these commands:
sudo su mkdir /opt/jdk tar -zxf jdk-8u181-linux-x64.tar.gz -C /opt/jdk update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_181/bin/java 100 update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_181/bin/java 100For OpenJDK, run
sudo apt install openjdk-8-jdk sudo apt install openjdk-8-jre
Install Apache ANT: For installing Apache Ant v1.10.3, run
sudo apt install antOnce you’re all set just enter the incubator-netbeans directory and type
antto build the Apache NetBeans IDE.Once built, the IDE bits are placed in the
./nbbuild/netbeansdirectory. You can run the IDE from within the incubator-netbeans directory by typing./nbbuild/netbeans/bin/netbeansor useant trymeto run the Apache NetBeans IDE.
Installing from Binaries: Download the binary zip from here. Unpack the zip and run
netbeansin bin folder using./netbeans. I'll suggest to make adesktop entrya.k.a. menu shortcut. For details about it read this and this.
For natively installing Netbeans v8.2, See Karel's answer.
Original Answer:
Java seems to be quite broken currently under 18.04. This can create problems with Netbeans as well as Eclipse. So, I'll suggest not to install Java from Ubuntu's repository.
If you want JDK as well as Netbeans first of all remove Java completely from your system. Then download NB+JDK from here.
I assume that downloaded files go to Downloads and downloaded file name is jdk-8u111-nb-8_2-linux-x64.sh. Use below commands to install Netbeans and JDK 1.8.
Navigate to the folder(Downloads) containing file using
cd ~/DownloadsMake file executable(if already not) using
chmod +x jdk-8u111-nb-8_2-linux-x64.shFinally run it using
./jdk-8u111-nb-8_2-linux-x64.shFollow on screen instructions to complete installation.