我只是尝试安装Netbeans,但JDK有更多问题 [英] I just try to install Netbeans but there are more probs with JDK
问题描述
我在ubuntu上是新的,我想使用netbeans.我从其网站下载了netbeans,然后将此命令写到了该行
im new at ubuntu and i want to use netbeans. I downloaded netbeans from its web site then I wrote this commands to the line
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
After I get above notification I tried to install JDK with these commands
hakki@hakki-K55VM:~$ sudo apt-get install openjdk-7-jre-headless
....
done
然后我控制了jdk的正确安装,并在下面的行中返回了
then I controled jdk installed properly and it returned below lines
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.我该如何解决这个问题?
After I download jdk I tried to install netbeans again but still it returns error and it cant initialize UI. How can I solve this problem?
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运行时环境).
The NetBeans says it needs a JDK (Java Development Kit), but you only installed a JRE (Java Runtime Environment).
我尝试使用这些命令安装JDK
I tried to install JDK with these commands
hakki@hakki-K55VM:~$ sudo apt-get install openjdk-7-jre-headless
您安装的是JRE,而不是JDK.
You installed a JRE, not JDK.
这应该足够了
sudo apt-get install openjdk-7-jdk
这篇关于我只是尝试安装Netbeans,但JDK有更多问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!