• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running in to some trouble

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

Kudos,
~nerieru
 
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no need of extension

java DooBee is enough
 
harilal ithikkat
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JAVARANCH.......
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As harilal ithikkat pointed out, you should compile using

javac DooBee.java

and run using
java DooBee

not

java DooBee.class
 
ner ieru
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, that fixed my problems! I thank you kindly

And thanks for the welcome
 
ner ieru
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Please do not shoot the fish in this barrel. But you can shoot at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic