我是 ubuntu 的新手,我想使用 netbeans。我从它的网站下载了 netbeans 然后我把这个命令写到行
hakki@hakki-K55VM:~/Downloads$ chmod +x netbeans-7.4-linux.sh
hakki@hakki-K55VM:~/Downloads$ sudo bash netbeans-7.4-linux.sh
[sudo] password for hakki:
Configuring the installer...
Searching for JVM on the system...
Java SE Development Kit (JDK) was not found on this computer
JDK 7 is required for installing the NetBeans IDE. Make sure that the JDK is properly installed and run installer again.
You can specify valid JDK location using --javahome installer argument.
To download the JDK, visit http://www.oracle.com/technetwork/java/javase/downloads
收到上述通知后,我尝试使用这些命令安装 JDK
hakki@hakki-K55VM:~$ sudo apt-get install openjdk-7-jre-headless
....
done
然后我控制jdk安装正确,它返回下面几行
hakki@hakki-K55VM:~$ java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.4) (7u51-2.4.4-0ubuntu0.13.10.1)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
下载 jdk 后,我尝试再次安装 netbeans,但它仍然返回错误并且无法初始化 UI。我该如何解决这个问题?
hakki@hakki-K55VM:~/Downloads$ sudo bash netbeans-7.4-linux.sh
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...
Can`t initialize UI
Running in headless mode
Exception: java.awt.HeadlessException thrown from the UncaughtExceptionHandler i
最佳答案
NetBeans 说它需要 JDK(Java 开发工具包),但您只安装了 JRE(Java 运行时环境)。
I tried to install JDK with these commands
hakki@hakki-K55VM:~$ sudo apt-get install openjdk-7-jre-headless
您安装的是 JRE,而不是 JDK。
这应该够了
sudo apt-get install openjdk-7-jdk
关于java - 我只是尝试安装 Netbeans,但 JDK 有更多问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22120093/