• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Taking community college online course in Java 1

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You must add %JAVA_HOME%\bin to your system %PATH% variable.
 
M Jessie Barczak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
M Jessie Barczak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
M Jessie Barczak
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Understand path.
don't understand classpath
is that another step?
instructor doesn't mention classpath.
MJB
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You shouldn't have to worry about the classpath right now. PATH is good enough. Set that and happy compiling.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Marilyn de Queiroz
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic