简体   繁体   English

Netbeans安装找不到JRE

[英]Netbeans Installation cannot find JRE

I am trying to install Netbeans 8.2 on my Microsoft surface pro and I am using JDK 10.0.2. 我正在尝试在Microsoft Surface Pro上安装Netbeans 8.2,并且正在使用JDK 10.0.2。 When I run the Netbeans installer it is unable to find the JDK. 当我运行Netbeans安装程序时,无法找到JDK。 So I used the --javahome command with the correct file destination and I suppose it finds the JDK. 因此,我将--javahome命令与正确的文件目标一起使用,并且我想它找到了JDK。 But then it throws the same error for the JRE. 但随后,它将为JRE引发相同的错误。 I do not know why the JRE cannot be found. 我不知道为什么找不到JRE。 I have been reading many similar questions and am seeing directions saying to use JAVA_HOME and set the environment variables. 我已经阅读了许多类似的问题,并且看到说明说要使用JAVA_HOME并设置环境变量。 I am very unfamiliar with the windows command prompt, so I would appreciate a more specific solution. 我对Windows命令提示符非常不熟悉,因此,我希望您能找到更具体的解决方案。

As much as I know, JDK doesn't come with JRE, so check in your Java folder if you got JRE installed, if not, try downloading it manually. 据我所知,JDK并不随JRE一起提供,因此请检查您的Java文件夹中是否安装了JRE,否则请尝试手动下载它。

Hope that helps 希望能有所帮助

Version 8.2 of NetBeans does not support JDK 10. NetBeans 8.2版不支持JDK 10。

However, ownership of NetBeans has recently been moved from Oracle to Apache and you can use JDK 10 with NetBeans 9.0 RC1 (RC = "Release Candidate"). 但是,NetBeans的所有权最近已从Oracle移交给Apache,并且您可以将JDK 10与NetBeans 9.0 RC1一起使用 (RC =“发行候选”)。

Just download the zip file, unzip it and then locate and run netbeans64.exe (or netbeans.exe for 32-bit) within the unzipped folder. 只需下载zip文件,将其解压缩,然后在解压缩的文件夹中找到并运行netbeans64.exe (或32位的netbeans.exe )即可。 Those steps are the same regardless of operating system. 无论使用什么操作系统,这些步骤都是相同的。

When NetBeans starts it should automatically locate your installed JDKs, but verify that you have JDK 10 included as a Java Platform from the Tools > Java Platforms screen: NetBeans启动时,它应该自动找到已安装的JDK,但是请从“ 工具”>“ Java平台”屏幕中验证是否已将JDK 10作为Java平台包括在内:

Java平台

You can explicitly add JDK 10 to NetBeans if necessary: 如有必要,可以将JDK 10显式添加到NetBeans:

  • Tools > Java Platforms 工具> Java平台
  • Click Add Platform and complete the wizard to add JDK 10. 单击添加平台,然后完成向导以添加JDK 10。

Once you have JDK 10 included in Java Platforms you can create a trivial Java 10 project, although the process is not completely intuitive: Java平台中包含JDK 10之后,您可以创建一个简单的Java 10项目,尽管该过程并不十分直观:

  • File > New Project > Java > Java Application 文件>新建项目> Java> Java应用程序
  • Accept all the default options. 接受所有默认选项。 A new project with a name of the form JavaApplication{n} will be created. 将创建一个名称形式为JavaApplication {n}的新项目。
  • In the Projects panel select the project's node, right click and select Properties from the popup menu. 在“ 项目”面板中,选择项目的节点,右键单击并从弹出菜单中选择“ 属性 ”。
  • Select Libraries from the list of Categories and set Java Platform to JDK 10 . 类别列表中选择 ,并将Java平台设置为JDK 10
  • Select Sources from the list of Categories , set Source/Binary Format to JDK 10 and click OK . 类别列表中选择Sources ,将Source / Binary Format设置为JDK 10 ,然后单击OK

You now have a Java 10 project. 您现在有一个Java 10项目。 To verify that, make sure that the following code compiles as your main() method: 要验证这一点,请确保以下代码作为您的main()方法编译:

public static void main(String[] args) {
    var v = 7;
}

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

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