PDA

Click to See Complete Forum and Search --> : Newbie wants to know....


Smily
May 17th, 2002, 04:53 AM
Hi,

I know c and c++ fair enough. I would like to lean java.

Actually I have visual studio except java. So I downloaded sun java jdk from sun. but does not work to me properly, It might have been my mistake.

Can anyone please expalin me what I should do to write my first program in java? ..........

CreoN
May 17th, 2002, 04:59 AM
First of all, install the SDK :D
The path to it shouldn't have any spaces.

Put your sdk\bin-folder in the path-variable.
Set the classpath-variable to .
If you haven't got a classpath, create it.

That should be all...
compiling:
javac JavaFile.java

running:
java JavaFile

The filename has to be the same as the class-name in the code.

Smily
May 17th, 2002, 05:25 AM
Thanks CreoN

I am following your instruction, let u know shorly

Dillinger4
May 17th, 2002, 02:24 PM
You can also use the -classpath switch when running your programs if the directory where you are running your program differs from your CLASSPATH environment variable in the autoexec.bat. ie...... C:\ java -classpath C:\MyDirectory; MyProgram