Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error running simple program in NetBeans 9.0

Tags:

netbeans

I'm trying to use NetBeans for a JDBC project. However, I'm getting runtime errors when I try to compile. I decided to try a "hello world" project and I couldn't get that to run also. I'm in NetBeans 9.0 with Java JDK 10.0.2.

Error Message:

Exception in thread "main" java.lang.RuntimeException: 
at javaapplication2.JavaApplication2.main(JavaApplication2.java:1)
C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:68: Java returned: 1
BUILD FAILED (total time: 1 second)

xml debug:<call-java classname="@{classname}" classpath="@{classpath}" modulename="@{modulename}" modulepath="@{modulepath}">

package javaapplication2;

public class JavaApplication2 {


public static void main(String[] args) {


    System.out.println("Hello");
}

}

enter image description here

like image 283
eggo Avatar asked Jun 07 '26 06:06

eggo


1 Answers

It is very easy, your JDK version is not 100 % compatible; use version 8.2, which is the most stable for Arduino and others.

To change platforms without deleting the existing one, simply go to Tools / Java Platforms / click on the button add Platforms.

like image 151
user13676568 Avatar answered Jun 10 '26 13:06

user13676568



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!