简体   繁体   English

如何更改 Netbeans 12.2 的默认 SDK?

[英]How can I change the default SDK for Netbeans 12.2?

When setting up Netbeans 12.2, one part of the installer lets you select the JavaSDK that you'll use as the Default.设置 Netbeans 12.2 时,安装程序的一部分允许您 select 将用作默认值的 JavaSDK。 Is there any way to change this later on, like when a new version of the JavaSDK comes out?以后有什么办法可以改变这一点,比如当 JavaSDK 的新版本出现时?

It is possible to change the platform later.以后可以换平台。

You need to distinguish between two platforms:您需要区分两个平台:

  • the one that netbeans is running on (yes, it is a Java based IDE) netbeans 正在运行的那个(是的,它是一个基于 Java 的 IDE)
  • the one that will be used to compile your project将用于编译您的项目的那个

If you want to change the Java version for the IDE, check the configuration file in the netbeans/etc folder (on my windows machine it is C:\Program Files\NetBeans-12.2\netbeans\etc\netbeans.conf . In line 76 I see the variable netbeans_jdkhome . If you want to change the Java version for the IDE, check the configuration file in the netbeans/etc folder (on my windows machine it is C:\Program Files\NetBeans-12.2\netbeans\etc\netbeans.conf . In line 76我看到变量netbeans_jdkhome

If you installed another JDK on your machine and want to choose that for projects, inside Netbeans go to Tools/Java Platforms.如果你在你的机器上安装了另一个 JDK 并想为项目选择它,在 Netbeans go 到工具/Java 平台。 Add your new installation.添加新安装。 Then when you go to some project's properties, look at the Build/compile settings.然后当你 go 到某些项目的属性时,查看构建/编译设置。 Choose your new java platform, and it will be used for your project.选择您的新 java 平台,它将用于您的项目。

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

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