netbeans installation error: can't initialize

2020-04-02 18:33发布

问题:

I'm trying to install NetBeans on Linux Mint, and I'm getting the following error every time I run the installation script:

Configuring the installer... Searching for JVM on the system... Extracting installation data... Running the installer wizard... Can`t initialize UI Running in headless mode

What should I do to get it working?

回答1:

Looks like Netbeans does not work properly with Openjdk. This is what I did (in Linux Mint 12):

sudo apt-get remove openjdk*
sudo apt-get install sun-java6-jdk

Then you will be able to run the .sh installer as usual.



回答2:

In case anyone has this problem in the future, Netbeans doesn't like OpenJDK 6 but -- fortunately -- it works fine with OpenJDK 7 (as expected as for Java 7 OpenJDK is the reference implementation). Just make sure you remove any Java 6 packages before installation attempts. On Ubuntu and Mint one can do:

sudo apt-get purge ^openjdk-6-*
sudo apt-get install openjdk-7-jdk

It should work afterwards.



回答3:

I hit this same issue on Kubuntu 12.04 LTS but needed Sun JDK 6 for a project I'm maintaining. I stumbled upon Martin Wimpress' OAB-Java script (by way of help.ubuntu.com) which creates and installs a local apt repository for Sun JDK 6. You can find the latest instructions on Martin's github site which run as follows:

cd ~/
wget https://github.com/flexiondotorg/oab-java6/raw/0.2.7/oab-java.sh \
-O oab-java.sh
chmod +x oab-java.sh
sudo ./oab-java.sh

If you want to see what this script is doing while it is running then execute the following from another shell:

tail -f ./oab-java.sh.log

Alternatively, you can clone the OAB-Java repo and kick of the script from within it:

git clone git://github.com/flexiondotorg/oab-java6.git
cd oab-java6
sudo ./oab-java.sh

Either way, once that is in place follow Jose's instructions to remove openjdk and install sun jdk:

sudo apt-get remove openjdk*
sudo apt-get install sun-java6-jdk


One final note, the script accepts a -7 argument which will create and install a local apt repository for Oracle JDK 7 should you want to go that route.



回答4:

I was able to get it to work by getting into the target system using ssh -X, then making sure DISPLAY was exported. That handles the X server issues.



回答5:

  1. Change the priority of the Oracle Java executables:

    export PATH=/usr/java/latest/bin:$PATH

  2. Run the installer:

    ./netbeans-8.1-linux.sh



回答6:

What worked for me was installing default java environment from the terminal:

sudo apt-get install default-jre