multi file

Do you have a compilation error or a difficult problem to solve? Ask for help here
Post Reply
camouser1s@gmail.com
Posts: 2
Joined: Wed Aug 08, 2018 5:25 pm

multi file

Post by camouser1s@gmail.com » Sun Aug 12, 2018 6:43 pm

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?

dbremmen@gmail.com
Posts: 63
Joined: Sun Jan 07, 2018 6:30 pm

Re: multi file

Post by dbremmen@gmail.com » Tue Aug 14, 2018 3:21 am

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

camouser1s@gmail.com
Posts: 2
Joined: Wed Aug 08, 2018 5:25 pm

Re: multi file

Post by camouser1s@gmail.com » Tue Aug 14, 2018 2:50 pm

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.

dbremmen@gmail.com
Posts: 63
Joined: Sun Jan 07, 2018 6:30 pm

Re: multi file

Post by dbremmen@gmail.com » Fri Aug 17, 2018 1:20 am

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

Post Reply