Answer the question
In order to leave comments, you need to log in
Why is the java code not compiling?
I'm trying to compile this code:
package com.company;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
javac HelloWorld.java
java -classpath . HelloWorld
could not find or load main class HelloWorld
Answer the question
In order to leave comments, you need to log in
What to do?
javac -d . HelloWorld.java
java com.company.HelloWorld
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question