• 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
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Java Classpaths On WinXP

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have Windows XP and I think I am having trouble setting the classpath. Whenever I run a program it says "javac is not recognized as an internal or external command".
I know to set a classpath you go to environment variables then I dont know what to type in the system variables section. I have the book Java 2 for dummies and they explain that I should add the bin directory to my systems path and then det a CLASSPATH variable (where I plan to put my "java programs"). But how do I do this?
 
buckaroo
Posts: 401
Postgres Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What about your path variables? Did you change those as well? For the way I had loaded the SDK I placed this in my path statement:
C:\j2sdk1.4.1_02\BIN;C:\j2sdk1.4.1_02\JRE\BIN
Hope this helps
doco
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Natasha,
Doco is right. The problem you're having is the system PATH variable is not set to find javac. All the executables for the JAVA SDK are located in the bin subdirectory of wherever the SDK is installed. I'm not sure about XP, but for Win 2000 if you right click MyComputer and select properties, that will bring up the System Properties dialog. You then click the Advanced tab and next the Environment Variables button. Scroll down in the bottom window (System variables) and highlight the PATH variable and click Edit. In the Variable value text window, click at the end of the line and add ;<SDK PATH>/bin. You need to substitue <SDK PATH> for the real path. For example C:\j2sdk1.4.1
Hope this helps,
Michael Morris
 
Ranch Hand
Posts: 204
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello Natasha,
As others have mentioned it's the 'path' (Variables) which is the problem if 'javac' is not being recognized as a command.
In XP you'd have to follow this procedure:
Click Start - Control Panel - System (Click Classic View incase the new view doesn't show you) - Advanced Tab - Environment Variables
Here on the first window (of the 2) click on path and then click on edit.
At the end add this
C:\jdk\bin
Ofcourse 'jdk\bin' could be substituted with your location of the source code.
Hope it works.
-ST
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic