Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Running in to some trouble

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Quote
  • Report post to moderator
Welcome to JAVARANCH.......
 
Sheriff
Posts: 9099
12
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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: 12893
63
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • 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.
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic