File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Trouble running first application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trouble running first application" Watch "Trouble running first application" New topic

Trouble running first application

Brendon Gehring

Joined: Aug 24, 2006
Posts: 2
I've tried to follow the directions for running the HelloWorldApp, but seem to be doing something wrong somewhere.

I create the text file using Notepad, saving it as "".

I then change the current directory in the Command Prompt to the file containing by typing "cd c:\Java Practice" (without the quotes). This seems to work.

I then try to compile the code by typing "javac" to the command line (again, without the quotes), and get the following error: 'javac' is not recognized as an internal or external command, operable program or batch file.

I have a j2sdk1.4.2_12 folder directly on my C drive with the bin and jre files inside that. The bin folder contains the executable, javac.exe. I think I haven't told the Command Prompt where javac is located some how, but don't know the missing step.

Apologies for the low level of the question. Have just been banging my head against the computer for a day now...
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

5. Update the PATH variable

(this is for 1.5, but the procedure is the same for 1.4.2)

[My Blog]
All roads lead to JavaRanch
Sanjaya Sugiarto
Ranch Hand

Joined: Mar 25, 2004
Posts: 229
you should configure your system variables.

in windows:
start >> Settings >> Control Panel >> System >> Advanced >> Environment Variables

Search for variable 'Path' than add (using ';' as separator):
C:\folder_where_you_install_jdk\bin (e.g C:\j2sdk1.4.2_12\bin)

Add new variable JAVA_HOME and as value:
C:\folder_where_you_install_jdk (e.g C:\j2sdk1.4.2_12)

(you can skip this step, it's just for checking: start >> run >> type 'cmd' without quote >> and type 'java -version' without quote. If you get something like "java version 1.4.2_12 blablabla" than you have done right with your system variables)

Back to the system variables:
Add new variable CLASSPATH and as value:
your_project_path (in your case the folder path where you saved

<a href="" target="_blank" rel="nofollow">Business Information Technology - Hochschule Furtwangen University, Germany</a>
Brendon Gehring

Joined: Aug 24, 2006
Posts: 2
Thank you Satou for the great link. It provides a lot of great information.

And thank you Sanjaya for the very clear, step by step directions. They really made it easy, and all worked as advertised.
I agree. Here's the link:
subject: Trouble running first application
jQuery in Action, 3rd edition