multi file
-
- Posts: 2
- Joined: Wed Aug 08, 2018 5:25 pm
multi file
I have a project here with two files stats.java and statsApp.java. Project runs fine in netbeans but im getting "couldnt find or load main class" error here. Is there a special way to incorporate multiple files with the compiler here?
-
- Posts: 63
- Joined: Sun Jan 07, 2018 6:30 pm
Re: multi file
Hi! Thanks for posting,
When starting a Java application you need to define the class that have the starting point (I mean the main method).
To do this you need to:
- right click on your project
- click project properties from the menu
- fill the main class name (in your case I think is: statsApp
- click save
I hope this helps
When starting a Java application you need to define the class that have the starting point (I mean the main method).
To do this you need to:
- right click on your project
- click project properties from the menu
- fill the main class name (in your case I think is: statsApp
- click save
I hope this helps
-
- Posts: 2
- Joined: Wed Aug 08, 2018 5:25 pm
Re: multi file
I'm still getting the same error. "Error: Could not find or load main class StatsApp.java". Also tried just StatsApp with no extension. Even started a new project and tried it but still the same.
-
- Posts: 63
- Joined: Sun Jan 07, 2018 6:30 pm
Re: multi file
Hi!
I reviewed your program and updated the properties.
The problem is that you have a package and you need to specify the package with the className in the main class name box
Regards!
David
I reviewed your program and updated the properties.
The problem is that you have a package and you need to specify the package with the className in the main class name box
Regards!
David