HaloTV
HaloTV

Reputation: 31

NetBeans IDE not running project or file

I have worked with NetBeans in the past and I wanted to work with it again, it was a long process of installing but I finally got it, and now that I am here it will not let me run my projects. For one: It does not create a project with ant(at all) For two: whenever I create a class it does not automatically close the name the class screen For Three: When I right-click my class the run-file option is greyed out For four: When I click run project the screen is stuck on "Initializing view, please wait..."

I really need to get this to work and I just can't seem to figure out what I'm doing wrong or if I am even doing something wrong.

Upvotes: 2

Views: 17143

Answers (4)

Eshika Verma
Eshika Verma

Reputation: 16

Write click on project->properties->run->Relative Url->Specify the file name that you want to run

After this the specified file will run by clicking the green run button given on the top.

Upvotes: 0

Thodoris Roumanis
Thodoris Roumanis

Reputation: 41

Had the same issue, couldn't get it to work for the life of me, installed the latest version and everything went smoothly. I suggest not wasting time troubleshooting as I did, but instead updating to the latest version first.

Upvotes: 1

JustGuest
JustGuest

Reputation: 21

Regarding the 4th problem:

You need to set the main class in your project.

  • Right Click on the project folder, then click properties.
  • Get to the tab run.
  • Now type in the direction of your Main class you want to run: package + name of the class

example: package name: com.mycompany.myproject class name: MyClass.java -> directory of Main Class: com.mycompany.myproject.MyClass

  • click ok and try again

Worked for me

Upvotes: 2

voltaire
voltaire

Reputation: 21

Some suggestions to try:

  1. Run a clean and build
  2. Right click the project --> properties --> ensure the correct main class is set
  3. Upgrade and/or restart NetBeans

Good luck!

Upvotes: 1

Related Questions