Forums Register Login

Help-virgin programmer. I don't know how to enter and compile a program

+Pie Number of slices to send: Send
I downloaded java2 sdk 1.4.1 successfully to my c drive. I wrote a sample program in the book. Where do I need to save it? I click the javac.exe and it disappears right away. It doesn't give me time to enter anything in the command prompt. Am I doing something wrong. Anybody's help would be greatly appreciated. Here is the following code that I wrote:

/*
This is a simple java program
Call this file Example.java.
*/
class Example {
// A Java program begins with a call to main ( ).
public static void main (String args[] ) {
System.out.println ("Java drives the web.");
}
}
+Pie Number of slices to send: Send
hi
check out the first steps tutorial on the sun site
try the turial and if anything is unclear, then repost.
k
+Pie Number of slices to send: Send
ok, I'll check it out Karl and let you know what I come up with. I appreciate your help.
+Pie Number of slices to send: Send
Ok, I'm almost done with my first program. I'm not sure if this is what I want to do. I spent a long time just getting the code to compile. Now I can't see the out put because the directory I'm in is not where the bytecode is. Any help. I tried the root drive c and also the c:\j2sdk1.4.1_01 and also the c:\j2sdk1.4.1_01\bin drive in which I was able to compile the code.
+Pie Number of slices to send: Send
I figured it out from the sun site. I had to set the CLASSPATH. Well as you all can see, I have a long way to go. I'm just getting my feet wet. From the looks of things, I hope I don't drown!!!
+Pie Number of slices to send: Send
dont worry.
everybody started like this.
but learning it this way will never let you forget the CLASSPATH again :-)
k
+Pie Number of slices to send: Send
For a simple program such as that, you do not need to set up a CLASSPATH. And once you have installed j2sdk1.4.1_01 and set your PATH ( not CLASSPATH ) to include c:\j2sdk1.4.1_01\bin you should be able to edit, compile , and execute that program in any one working directory. Stay away from c:\j2sdk1.4.1_01 it is sacred. Assuming you are using a "simple" editor of course .
Destroy anything that stands in your way. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 694 times.
Similar Threads
unable to run simple program in eclipse 3.2
How a character save in 2 bytes in Java?
calling C from java
new to java help pls
SWT Browser- calling java function from html
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 20:39:14.