This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Originally posted by Anand Hariharan: Either you do not have the JDK installed (i.e., only the Java runtime environment, not the Java development kit), or javac for some reason, is not in the path, while java is.
Agree. It is possible you have the JRE (Java Runtime Environment) installed and not the JDK. that would mean you can run Java but not create new programs. If you need to download the JDK, try here: click the button nearest the top of the page. It gives you installation instructions. This part of the Java Tutorial tells you about "getting started;" note the "Common Problems" link, and at the end of "common problems" there is a link to how to set the PATH.
Good luck with it.
Joined: Sep 07, 2006
Now I have reinstalled the JDK. Now, if I run the command "java -version" the following message appears:
java version "1.6.0_04" Java(TM) SE Runtime Envinronment (build 1.6.0_04-b12) Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)
If I run "javac -version" the following message appears: javac 1.6.0_04
Now I am able to compile the HelloWorldApp.java and create the HelloWorldApp.class. But if I run the command "java HelloWorldApp" from the directory where the HellowWorldApp.class exist, I get the following message: