aspose file tools*
The moose likes Beginning Java and the fly likes Trying to do the first exercises Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trying to do the first exercises " Watch "Trying to do the first exercises " New topic
Author

Trying to do the first exercises

Rusty Gordon
Greenhorn

Joined: Jun 26, 2009
Posts: 6
Ok ive been trying to do the first exercises in the head first java book the one with the party and the one with the dog i input the source code onto the notepad and i save it as an all file not a txt then i click on it but all it does is open the notepad agian what am i doing wrong?!?!?!?!!?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2861
    
  11

I don't have the Head First Java book, but I think the step you're missing here is compiling the file. You save it as an "all" file, which I think means you tell Notepad not to save it as a text file (with a txt extension). That's good. You are saving it with a Java extension too I hope. Anyway, the book must teach how to compile and run a Java application. It's not just a matter of clicking on the file.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
Beware: the party is an incomplete application; you can compile it but it won't run.

And welcome to JavaRanch
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
And you are probably better off not using NotePad. Download Notepad2, NotePad++ or jEdit, which are all much better than NotePad for programming.
Rusty Gordon
Greenhorn

Joined: Jun 26, 2009
Posts: 6
hey everyone sorry i couldnt get back sooner ive had a pretty hectic past couple of days. Anyway thank you all for all your help suggestions and im going to try it out agian right now and see if I do it right. Once agian thanks!
W. Joe Smith
Ranch Hand

Joined: Feb 10, 2009
Posts: 710
Rusty Gordon wrote:hey everyone sorry i couldnt get back sooner ive had a pretty hectic past couple of days. Anyway thank you all for all your help suggestions and im going to try it out agian right now and see if I do it right. Once agian thanks!


No one mentioned it, but you said you are saving it as an "all" file. Whenever you save a Java program, save it as "PublicClassName.java" where PublicClassName is (usually) the name of your top level public class. If the file isn't a .java file the compiler will yell at you when you try to compile it.


SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
Rusty Gordon
Greenhorn

Joined: Jun 26, 2009
Posts: 6
ok so i downloaded jedit not using notepad anymore so now what?
W. Joe Smith
Ranch Hand

Joined: Feb 10, 2009
Posts: 710
Rusty Gordon wrote:ok so i downloaded jedit not using notepad anymore so now what?


I'm going to recommend going through this tutorial. It should help with basic programming, saving, compiling, and running a java program.

Note I linked the Windows version, but there are other versions on that site for other OS's too.
Rusty Gordon
Greenhorn

Joined: Jun 26, 2009
Posts: 6
W. Joe Smith wrote:
Rusty Gordon wrote:ok so i downloaded jedit not using notepad anymore so now what?


I'm going to recommend going through this tutorial. It should help with basic programming, saving, compiling, and running a java program.

Note I linked the Windows version, but there are other versions on that site for other OS's too.



thanks ill take a look at it
Rusty Gordon
Greenhorn

Joined: Jun 26, 2009
Posts: 6
ok so im following the tutorial but everytime i type cd C:/java another cmd screen flashes up the immediately closes whats up with that?
Rusty Gordon
Greenhorn

Joined: Jun 26, 2009
Posts: 6
ok so when im trying to do the exercise whenever i go to cmd i cant change it from C:\Documents and Settings\localuser>
I enter cd C:\java but i still get an error message i have tried everything i can think of grr its so frustrating!!
Fred Hamilton
Ranch Hand

Joined: May 13, 2009
Posts: 679
Do you get an error The system cannot find the path specified. ?

If you do, try typing cd c:\java

notice the difference in the slash


edit: sorry, I see you have that covered. Still, what is the error message you get? when you try to change directories?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39834
    
  28
Where is your "java" directory. Try moving it into "My Documents" bcause the command line on Windows usually opens with "My Documents" as its default location. Then try

cd java

If you are getting error messages (as Fred Hamilton has told you) make sure to tell us what they are.

Are you still getting windows appearing and disappearing? No idea what causes that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to do the first exercises