0

Hi everyone am new to java-ing i cant seem to create a class for my first application my "Hello World" when i type javac helloworld it returns that javac is not a in the path and i have created a path for java. Please help me.

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by kkcaddy
0

Hi kkcaddy, you need to add the .java extension to the javac command in order to compile a java file. I.e:

javac helloworld.java

then you can run the file by using the java command like so:

java helloworld

You can find more information on the javac command here:

http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html

I hope this helps. If this doesn't resolve your issue, please post the error message you are receiving, it might be that your environmental variable needs setting.
EDIT : Also, ensure that you are in the directory where your .java file is.

Edited by majestic0110: tidy up

0

If your shell does not understand javac command, you might want to add path to your javac in your PATH env variable.

katharnakh.

0

Problem solved, thanks to those who contributed.
To get javac i had to add c:\java\jdk1.6.0_01\javac HelloWorld.java.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.