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.

Recommended Answers

All 3 Replies

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.

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

katharnakh.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.