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

Beginner's classpath problem (I hope...)

 
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been programming in Java for quite a while now but I am now frustrated to no end:
1. I have a Windows XP machine.
2. I have the 1.4.1 SDK installed in directory c:\j2sdk1.4.1
3. I have JAVA_HOME set to c:\j2sdk1.4.1
4 I have a CLASSPATH environment variable set to .;%JAVA_HOME%;%JAVA_HOME%\bin;%JAVA_HOME%\lib\classes.zip;
I can run code using the 'java' command, but when I try to compile something with 'javac' I get the following error:
'javac' is not recognized as an internal or external command, operable program, or batch fie.
Why can't it find javac.exe (which is in the same directoryas java.exe???

Help!
Frustrated in Virginia,
joel
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would say first junk the CLASSPATH, you do not need it (yet).
Then add %JAVA_HOME%\bin to the front of your PATH variable.
Try it.
-Barry
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joel
Check the environment variables via control panel and make sure that javac.exe is located in your path. Sometimes this wont work (we use WinNT4 where I am, and it never seems to acknowledge the change) so as a backup create a batch file that reads
path=<your java home directory>\javac.exe
The other thing you might want to look at is textpad, which has a 'compile java' option build into the tools menu, its the best environment i have worked in or java development
Cheers
Scott Stevens, Analyst/Programmer
Dept. For Courts
Wellington (Of LOTR fame )
New Zealand
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Remember that PATH is for compiling and CLASSPATH is for running.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic