简体   繁体   English

在Linux OS上的Netbeans中使用正确的JDK或更改默认值

[英]Using the correct JDK or changing default in Netbeans on Linux OS

Disclaimer: I am new to Java, new to Linux, and new to Netbeans - apologies for any over/under explanation - please ask and I will add/remove info. 免责声明:我是Java的新手,Linux的新手,以及Netbeans的新手-对于任何过多/不足的解释表示歉意-请询问,我将添加/删除信息。

I have a model written in Java in Netbeans 8.2 that has been successfully running in NetBeans 8.2 on Mac OS. 我有一个用Java在Netbeans 8.2中编写的模型,该模型已在Mac OS的NetBeans 8.2中成功运行。 This version of NetBeans was downloaded with JDK8u171 (JDK/Java package). 该版本的NetBeans是随JDK8u171 (JDK / Java软件包)一起下载的。

All components of the model have successfully transferred through FTP (filezilla) to a remote Linux machine. 该模型的所有组件均已成功通过FTP(filezilla)传输到远程Linux计算机。

The Linux machine has a copy of Netbeans 8.2 and has java/1.8.0-oracle (and 1.6.0 and 1.7.0), and has java/1.8.0-openjdk (similarly, 1.6.0 and 1.7.0 also). Linux机器具有Netbeans 8.2的副本,并且具有java / 1.8.0-oracle (以及1.6.0和1.7.0),并且具有java / 1.8.0-openjdk (同样也具有1.6.0和1.7.0) 。

I am assuming that 1.8.0-oracle is the equivalent of JDK8u171 but I may well be wrong. 我假设1.8.0-oracle与JDK8u171等效,但是我很可能错了。

When I load netbeans using 当我使用加载netbeans时

module load java/1.8.0-oracle
module load netbeans
netbeans

The program opens (via remote desktop - x2goclient ), and I can search for the project and open it. 该程序将打开(通过远程桌面-x2goclient ),我可以搜索该项目并将其打开。

Once open, I see: 打开后,我会看到:

' myprojectitle (broken) ' in the project window on the left of the NetBeans GUI NetBeans GUI左侧的项目窗口中的“ myprojectitle(已损坏)

right click -> resolve problems 右键单击->解决问题

...opens a screen saying ...打开一个屏幕说

'The JDK is missing and is required to run some NetBeans modules Please use the --jdkhome command line option to specify a JDK installation or see http://wiki.netbeans.org/FaqRunningOnJre for more information.' “缺少JDK,并且它是运行某些NetBeans模块所必需的。请使用--jdkhome命令行选项来指定JDK安装,或有关更多信息,请参见http://wiki.netbeans.org/FaqRunningOnJre 。”

Does this mean I am using the wrong jdk/java package? 这是否表示我使用了错误的jdk / java包?

Or is the jdk package configured incorrectly in Netbeans, if so how can I reconfigure? 还是NetBeans中的jdk软件包配置不正确,如果可以,如何重新配置​​?

Any help would be greatly appreciated. 任何帮助将不胜感激。

The solution to this was found at The JDK is missing and is required to run some NetBeans modules JDK上找到了针对此问题的解决方案, 缺少该解决方案, 并且运行某些NetBeans模块是必需的

Whereby, java/1.8.0_171 needed to be installed and then netbeans needed to be opened as follows: 因此,需要安装java / 1.8.0_171,然后需要打开netbeans,如下所示:

netbeans --jdkhome /path/java/1.8.0_171

Apologies for a repeat, but hopefully this answer can either redirect or offer a solution 抱歉,请重复,但希望此答案可以重定向或提供解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM