NetBeans compiling confusion

M

Mr. Kite

I just started using NetBeans, and have seen two weird behaviors:

#1 Even though I have a specific class identified as the Project's main
class, if I have a non-main class at the front in the editor and click
the "Execute" arrow button to Compile/Run, the program won't run
properly. If I just switch focus in the Source Editor to the main class
and click run, it works fine.

#2 Sometimes I'll make changes to a class in the Source Editor, but
when I run it, the older (unchanged) version is used. If I make some
more changes, delete them, save the project, open and close the
project, and say some spells, and then click "Execute" again, it now
will work. This seems to happen totally at random.

What am I doing wrong?
Thanks for any help.
 
D

David Segall

Mr. Kite said:
I just started using NetBeans, and have seen two weird behaviors:

#1 Even though I have a specific class identified as the Project's main
class, if I have a non-main class at the front in the editor and click
the "Execute" arrow button to Compile/Run, the program won't run
properly. If I just switch focus in the Source Editor to the main class
and click run, it works fine.
NetBeans will execute the class you have selected which is an
advantage if you want to test that class. However, it may be
impossible to execute the class by itself and, consequently, you will
receive an error message. If you choose Execute via the Project Menu
it will execute your main class
#2 Sometimes I'll make changes to a class in the Source Editor, but
when I run it, the older (unchanged) version is used. If I make some
more changes, delete them, save the project, open and close the
project, and say some spells, and then click "Execute" again, it now
will work. This seems to happen totally at random.
I have only experienced this problem with a newly imported program. It
was solved by using Build All in the Project Menu. I hope another
contributor to the group can tell us both what we should be doing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

netbeans 3
Need help with Netbeans 5
JlayeredPane in netbeans 3
NetBeans development 4
netbeans 6.9 desigh tab 0
NetBeans strangeness 9
StrutsTestCase and Netbeans 1
problem with netbeans 0

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top