• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Path & Classpath

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am extremely knew to all this, and I see someone has touched on this before but..
I'm trying to get the HelloWorld program to work, and I keep getting a bad command or file name error.
My autoexec looks like:
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\CDROM;C:\JDK1.3.1_02\BIN;C:\JDK1.3.1_02\JRE\BIN
My Classpath=c:\jkd1.3.1_02\lib;.;c:\java
I type in at the c:\java prompt "javac HelloWorld.java" and get that bad command error.
What am I doing wrong?
thanks
ZJ
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That error just means javac is not in your path, try including "your_jdk_directory\bin" in your path (where your_jdk_directory is susbtituted by appropriate path )
Regards,
Bhushan
 
zach
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't understand, from the path that I showed above isn't the jdk directory\bin in my path already?
Does it have any correspondence to explorer, I have the jdk directory stored under folders c:\java\jdk...
What am I missing?
thanks
ZJ
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to compile your path should point to the c:/java/jdk1.3.1_02/bin where the javac.exe program is stored. (I think that is where you said that you put it.) You will need to change all your classpath and path references to show that it is a directory lower than you are saying now.

Also zach,
Welcome to the Java Ranch, we hope you’ll enjoy visiting as a regular however,
your name is not in keeping with our naming policy here at the ranch. Please re-register under an appropriate name as shown in the policy. Your display name should have two names separated by a space and not obviously fictitious.
Thanks again and we hope to see you around the ranch!!
reply
    Bookmark Topic Watch Topic
  • New Topic