-
Newbie wants to know....
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? ..........
-
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.
-
Thanks CreoN
I am following your instruction, let u know shorly
-
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