wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Running in to some trouble Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Running in to some trouble" Watch "Running in to some trouble" New topic

Running in to some trouble

ner ieru

Joined: Feb 12, 2009
Posts: 7
Hey there, I just got "Head First Java (2nd edition)"

And ran into some trouble with the examples on page 12 & 13

It compiles just fine, but when I try to run the class file I get the following error:

And this is the actual code:

What am I doing wrong?

Btw I'm using notepad++ to write my code, just the cmd from my windows xp sp3 for compiling and running the .class from the .java file

So I compile (which goes just fine) Hence I think the problem might be somewhere in my JDK folder
I can't run, I was able to run the first example though..

Any help is greatly appreciated

harilal ithikkat
Ranch Hand

Joined: Oct 06, 2008
Posts: 221
no need of extension

java DooBee is enough

SCJP 1.5
"A candle looses nothing by lighting another candle"
harilal ithikkat
Ranch Hand

Joined: Oct 06, 2008
Posts: 221
Welcome to JAVARANCH.......
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9044
As harilal ithikkat pointed out, you should compile using

javac DooBee.java

and run using
java DooBee


java DooBee.class

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
ner ieru

Joined: Feb 12, 2009
Posts: 7
Oh, that fixed my problems! I thank you kindly

And thanks for the welcome
ner ieru

Joined: Feb 12, 2009
Posts: 7
As I don't see an edit button

I would also like to thank you for your quick replies!

Edit: and after posting this message it appeared
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11150

The "cattle drive" forum is for questions about the Cattle Drive and it's assignments. this question probably belongs in the 'beginners' forum, so I'll move it over there for you.

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I agree. Here's the link: http://aspose.com/file-tools
subject: Running in to some trouble
Similar Threads
Basic package problems
Maybe it's me.
class file portability
Basic CLASSPATH problem on Mac OS X
Running Javaflow