Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 10-28-2004, 09:55 PM   #1 (permalink)
 
Newb Techie

Join Date: Jun 2004

Posts: 44

oaktree5489

Default Java 101

I am a complete newbie to computer programming and somewhere i found out that java is a good language to start with. I found a good site that tells u how to write a java file, what to put in it, and how to save it. The one thing i'm getting caught on is how to compile it. I think that when u do this it turns it into "computer" language, right? Some people say use a command prompt but i don't really know how to do that. I'm using windows xp and i found the command prompt (i think) but i have no idea how to use it. If anyone knows a good website that explains how to do all this or if someone can explain some of it thoroughly to me it would greatly appreciated.
Thanks in Advance
oaktree5489 is offline  
Old 10-29-2004, 10:38 AM   #2 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

You can use the command prompt or use an IDE. You can find a link with some IDE's

http://www.tech-forums.net/showthrea...threadid=31371
Just scroll down to the Java Resources Section

Now if you want to use the command prompt, follow this:

1. Install the JavaSDK (Preferably version 1.4.2 or 1.5.0) which you can get at http://java.sun.com/ (for this tutorial, I'm going to assume you installed the SDK to C:\Program Files\Sun\jSDK1.5.0\ or C:\Program Files\Sun\jSDK1.4.2\ depending on the version you installed
2. Open the command prompt by going to Start->Run and type cmd and press enter
3. Make your java file, such as HelloWorld.java then place it in a directory, I'm going to put it in C:\JavaFiles\
4. In the command prompt type (it changes you to the javafiles directory):
cd C:\JavaFiles\
5. Then type (This actually does the compiling):
c:\program files\Sun\jSDK1.5.0\bin\javac HelloWorld.java
6. Step 5 does the compiling, it creates a HelloWorld.class in the C:\JavaFiles\HelloWorld.class
7. To run the Hello World application type this in the commmand prompt (This runs the program):
C:\program files\Sun\jSDK1.5.0\bin\java HelloWorld
8. If you add the Javac and Java program to your environmental variables you only need to type:
cd <Dir that contains your java files>
javac HelloWorld.java
java HelloWorld

Just replace the < and > with your directory.

Hope that helps some
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
Old 11-01-2004, 08:06 PM   #3 (permalink)
 
Newb Techie

Join Date: Jun 2004

Posts: 44

oaktree5489

Default

Thanks a lot Iron that helped a lot. I used a couple of different sample programs that were run using the command promt and they all worked! Thanks again. By the way do you know if there is a way to find out all the functions java is cabable of. I know it'd be a long list but i'm wondering how everybody else knows what to write so they can tell java what to do. Also do you know of any good tutorials? Thanks for the help.
oaktree5489 is offline  
Old 11-02-2004, 01:29 PM   #4 (permalink)
 
Ultra Techie

Join Date: Sep 2003

Location: Bamberg, Germany

Posts: 549

Iron_Cross

Send a message via ICQ to Iron_Cross Send a message via MSN to Iron_Cross Send a message via Yahoo to Iron_Cross
Default

http://java.sun.com/j2se/1.5.0/docs/api

That's for Java 1.5.0. If you use 1.4.2 just change that portion of the addresss. I use that refrence for anything and everything.
__________________

See today\'s Penny-Arcade!(May contain foul lanuage)
Pain is weakness leaving the body.

PM Me for my MSN
Iron_Cross is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On