Trying to create a java application?
import java.lang.*;
public class Program{
public Program(){
}
public static void main(String args[]) {
System.out.println("Hello World from Compilr!");
System.out.println("Press any key to continue.");
}
}
What's wrong with this code, I can't get it to run. The error I get is :
"Could not find the main class. Program will exit."
I thought that I needed to put my public static void main method in a class called Project??
Click the settings button from the top bar in the IDE, and edit your main class to be "Program" without the quotes. The file containing the Program class should also be named Program.java
I'm not an expert on Java, nor do I even work with it, but here's my guess. Call it a shot in the dark.
You added a Constructor to the program class, yet you did not instantiate the program class inside the main block. Also, when creating a web app with Java, the default project has the default class extending some Java class. I'm not sure if that needs to be done with a console app or not, but it's worth a try.
----------------------------------------------------------------------------------------------------
"Coding your life, Compiling your dreams, and crashing your future."
Compilr - C# and VB.NET Advisor