Link to home
Start Free TrialLog in
Avatar of ryan423
ryan423

asked on

Running a JAVA program

Hi. I have Downloaded all the necesarry JAVA files I need. the SDK one I needed I downloaded. Now, (since I'm learning JAVA in school) I created a ".java" file but it doesn't execute using javac.exe or java.exe through the command prompt. I know this is probably been discussed on the homepage, But all I want to know is what I have to do (since I have the necesarry files) to compile and run a java programs. a step by step procedure would be helpful. Thanks.

Ryan
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of expertmb
expertmb

to compile
C:\myprogramdir\javac fileName.java
to run
java fileName
just check
@ the prompt do
C:\javac
All possible problems you could have with the classpath are described in the link I posted
Avatar of ryan423

ASKER

i'll check out the link thanks. would it be a permanent solution or would i have to do it everytime?
This is not an answer but advice.

You should consider downloading NetBeans from www.netbeans.org, or if you don't like IDE's, at least something like TextPad from www.textpad.com that can call the compiler for you. Especially earlier on in your learning career, NetBeans will be extremely useful for managing packages and error tracing. You have to pay for textpad, but NetBeans is 100% free.

>> would it be a permanent solution or would i have to do it everytime?
You have both options available
Avatar of ryan423

ASKER

All I had to do was set the path variable to something like "C:\j2sdk1.4.2_06\bin". Now it's permanent. Thanks a many zzynx.
Thanks