aspose file tools*
The moose likes Beginning Java and the fly likes Taking community college online course in Java 1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Taking community college online course in Java 1" Watch "Taking community college online course in Java 1" New topic
Author

Taking community college online course in Java 1

M Jessie Barczak
Greenhorn

Joined: Aug 24, 2005
Posts: 4
Hi, I reached an impasse. I am trying to compile a simple program but at the c:\applets prompt I am entering:

javac Howdy.java

This is the path I am supposed to be in. this is the directory where I have stored a program Howdy.java.

but when I enter this line listed above, here is the response:

javac is not recognized as an internal or external command, operable program or batch file

What is this professor trying to do ... drive me crazy?

Thank you,

MJB
Richard Anderson
Ranch Hand

Joined: May 20, 2005
Posts: 61
You must add %JAVA_HOME%\bin to your system %PATH% variable.


-Rich, SCJP 1.4
M Jessie Barczak
Greenhorn

Joined: Aug 24, 2005
Posts: 4
I already did the path setting in the same directory (c:\applets) and it still does not recognize the JAVAC command.

What is happening to cause it to not recognize the javac command?

Tanks,
MJb
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Your path must include the directory where javac.exe lives. If you installed Java the normal way, I think the command given above will do the job.

If not, you can hardcode the real path. Mine is a bit long and non-standard; you'll have to locate your JDK to set yours correctly.

SET PATH=d:\progra~1\Programming\Java\j2sejdk500\bin

I just made THIS guide. Let me know if it helps.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
M Jessie Barczak
Greenhorn

Joined: Aug 24, 2005
Posts: 4
Thanks. Here is a list of the files I found when I did a search for "javac.exe" on my computer:

c:\program files\java\jdk1.5.0_04\bin
c:\program files\common files\java\update\base images\jdk1.5.0.b64\tools\bin

then another line
just "bin" with no path!

I guess I have to set the jdk to the path where the "applets" are (per the instructor's direction) so how do I do that?
And what is that plain "bin" file with no path?

Thanks,

MJB
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
Here is a list of the files I found when I did a search for "javac.exe" on my computer:

c:\program files\java\jdk1.5.0_04\bin
c:\program files\common files\java\update\base images\jdk1.5.0.b64\tools\bin

then another line
just "bin" with no path!

I guess I have to set the jdk to the path where the "applets" are (per the instructor's direction) so how do I do that?
And what is that plain "bin" file with no path?


You need to set the PATH to c:\program files\java\jdk1.5.0_04\bin and your CLASSPATH to the path where your "applets" are (it looks like you are putting them in c:\applets). PATH is not equal to CLASSPATH.

Don't worry about the other bin files. You don't need them for what you are doing now.
[ August 27, 2005: Message edited by: Marilyn de Queiroz ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
M Jessie Barczak
Greenhorn

Joined: Aug 24, 2005
Posts: 4
Understand path.
don't understand classpath
is that another step?
instructor doesn't mention classpath.
MJB
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

You shouldn't have to worry about the classpath right now. PATH is good enough. Set that and happy compiling.


GenRocket - Experts at Building Test Data
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by M Jessie Barczak:
I already did the path setting in the same directory (c:\applets) and it still does not recognize the JAVAC command.

What is happening to cause it to not recognize the javac command?

Tanks,
MJb


The "C:\applets" directory should NOT be included in the PATH variable. You should only include the bin directory that contains the "java.exe" file. In your case it looks like you need to make sure the PATH variable includes "c:\program files\java\jdk1.5.0_04\bin".

HTH

Layne


Java API Documentation
The Java Tutorial
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9047
    
  10
Originally posted by M Jessie Barczak:
I guess I have to set the jdk to the path where the "applets" are (per the instructor's direction) so how do I do that?

Understand path.
don't understand classpath
is that another step?
instructor doesn't mention classpath.


Yes, classpath is another step. If the instructor hasn't mentioned it, don't worry about it. I'd like to know exactly what the instructor's direction was, because I don't understand what you have said ("set the jdk to the path where the 'applets' are").

You either need to set (add to) your path (globally in your environment settings) to c:\program files\java\jdk1.5.0_04\bin or you need to type it each time you compile.

For example,
C:\applets\>c:\program files\java\jdk1.5.0_04\bin\javac MyApplet.java

I think the first way is easier/simpler.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Taking community college online course in Java 1