• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When I Run Main Project in NetBeans (F6) It always runs a project that isn't even open

 
David Ausman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to using NetBeans and Java but am learning lots from the book Head First Java which I love.

However, I am having a problem with NetBeans when I click on the green arrow(Run Main Project F6) button. It keeps trying to run my project and then looks for a class in another completely unrelated project, which isn't even open. I don't understand how that can be happening. This class is not even in my code yet it is trying to compile with it. I have attached a screen print.

I am running the BeatBox application from the book and it keeps looking for the QuizCardBuilder class, which is in another project. This happens even if I open ANY other unrelated projects and try to run them. They all keep asking for the QuizcardBuilder class. It's crazy.
NetBeansIssue2.jpg
[Thumbnail for NetBeansIssue2.jpg]
Net Beans Issue
 
Tom Johnson
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you try right clicking on the project you want to execute and click Run, rather than using run main project. I suspect its always running the project that has been set as main project when you hit F6
 
Campbell Ritchie
Sheriff
Pie
Posts: 50171
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If at all possible, don't use IDEs until you are a lot more experienced. You quote the name of the class with your main method at the command line/terminal

javac MyClass.java
java MyClass

Note when you do and don't use extensions.
 
David Ausman
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to take your advice and stop using the IDE for now. I just started using it for the last few projects because it looked like it made things easier but it's caused more confusion. I wasn't having any problems when I was running things from the DOS prompt.

Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic