问题
I'm a beginner at programming and would like to know more about C++. I installed Netbeans since it says it supports Java (which I am currently studying the basics at school) and C++ (which I want to study for personal interest). But when I tried to create a new project, I can't find C++. So I followed tutorials and ended up trying to install the plugin. The thing is, it is not successful for me. A message says:
"The Plugin Installer found problem timeout of loading C/C++ Remote Development API[org.netbeans.modules.cnd.api.remote/1.29.5.1] while install the following plugins: C/C++"
JDK version: java version "14.0.2" Java(TM) SE Runtime Environment (build 14.0.2+12-46) Java HotSpot(TM) 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
NetBeans version: Apache NetBeans IDE 11.0 (Build incubator-netbeans-release-404-on-20190319)
Windows 10
Any recommendation/solution for me to both run Java and C++ on Netbeans? Thank you!
回答1:
It did work for me downgrading the default Java from version 14 to version 11.
After having commented somewhere above my unsuccessful experience like yours. I decided to try it again but now focusing on Java version. I realized that Java version was the common point between your and mine environment. You tried Netbeans 11 but I the recent version 12, and I had successful experiences in the past using C/C++ plugin with versions 11.1, 11.2 and 11.3 of Netbeans.
I didn't go deeper to answer why it worked with Java 11 and not with 14. However, I can't believe it is the JVM version purely.
Later, after the installation I changed it again to Java 14, and it's still working. Below is the output terminal:
$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
2 /usr/lib/jvm/java-13-oracle/bin/java 1091 manual mode
* 3 /usr/lib/jvm/java-14-oracle/bin/java 1091 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to provide /usr/bin/java (java) in manual mode
$ java --version
openjdk 11.0.8 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed mode, sharing)
$ /media/sf_downloads/Apache-NetBeans-12.0-bin-linux-x64.sh
Configuring the installer...
Searching for JVM on the system...
Extracting installation data...
Running the installer wizard...
$ sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 auto mode
* 1 /usr/lib/jvm/java-11-openjdk-amd64/bin/java 1111 manual mode
2 /usr/lib/jvm/java-13-oracle/bin/java 1091 manual mode
3 /usr/lib/jvm/java-14-oracle/bin/java 1091 manual mode
Press <enter> to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/java-14-oracle/bin/java to provide /usr/bin/java (java) in manual mode
$ java --version
java 14.0.2 2020-07-14
Java(TM) SE Runtime Environment (build 14.0.2+12-46)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
My Linux version:
$ uname -a
Linux devmint 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
The plugin appears as: "User Installed Plugin"
回答2:
Experienced this problem with Netbeans 12. As experiment installed 11 but in the install dialog for the location and Java selection I didn't allow the JDK 15. I selected the current default Java 11. The C++ install worked.
Uninstalled 12 and reinstalled with changing to default Java. It installed C++ fine and works okay.
来源:https://stackoverflow.com/questions/63047487/c-wont-install-in-netbeans-11-0