Internal vs. External Execution in Netbeans (newbie)

J

James Bond

I am a total newbie to java, and am having trouble understanding just
what is happening during external execution in Netbeans. Allow to tell
the whole story.

First, I wanted simple blank document to begin work on, and it seemed
that there was no such thing. I was stuck using the various templates
and much to my surprise, a clean slate is not one of the options. So I
just opened the "Java Main Class" and deleted everything in it and saved
it as a new template called "Blank."

I noticed, however, that my little practice projects would compile just
fine, but not run when executed from within Netbeans (though they ran
just fine when I executed them from the the command line). I would always
(on a bunch of separate projects) get this error on execution (this
specific error came from a little project called Weather2 which converts
F/C temps -- but I get that same message on all of my little projects
that use my Blank template):

java.lang.NoClassDefFoundError: Weather2
Exception in thread "main"

Now if I type these projects in using the templates that came with
Netbeans (as opposed to my modified Blank one) it works okay.

While trying to figure all this out, I discovered the option to execute
internally or externally. I changed my Blank template to execute
internally and then everything executes okay.

But I understand that it is generally better to execute this stuff
externally, and I want a better understanding of what is going on. So
here, specifically, are my questions:

1. What specifically did I eliminate from the template that I blanked
out that would affect execution like I describe? All I saw was the
start/end of a class block and the main block. I don't see anything that
would seem to relate to external vs. internal execution, but clearly
there is something.

2. Just what is the IDE trying to do when executing externally that
would cause it to fail as I have described, yet I can manually execute it
from the command line okay (which is what I would assume Netbeans is
basically doing anyway).

3. How can I fix things so that I can use my Blank template, and execute
externally (if that has not already been answered as part of anwering my
first two questions).

Thank you very much for your help.

James
 

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

Members online

Forum statistics

Threads
473,772
Messages
2,569,588
Members
45,100
Latest member
MelodeeFaj
Top