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."); } }
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.
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!!!
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 .
Post by:autobot
Destroy anything that stands in your way. Except this tiny ad:
a bit of art, as a gift, that will fit in a stocking