• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

something wrong with JAVAC

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am exactly doing this:

1) writing my program in a text file say the path is "c:\myprograms\src\abc.java"
2) opening command prompt and going to src directory
3) my java is in "c:\program files\java\jdk\bin"
4) so running the following command "set classpath="C:\Program Files\Java\jdk1.6.0_18\bin";"

Now to test if class path is set I am typing java in the prompt and pressing enter... It is recognizing the command correctly...

But when i am typing javac and pressing enter its not recognizing it..... it gives

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

Don't know what could be wrong.... since i am setting up class path here only.. i dont think the error is due to environment variables....

I also uninstalled and reinstalled the JDK.. but not working....

Thanks in advance for the help!!
 
author
Posts: 23956
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The class path is for class files, not for executables. For executables, you need to add it to the windows path variable. And you need to *add* it, not replace it, or other executables in windows will no longer work.

Henry
 
vicky chauhan
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Henry....

it was a silly mistake.. infact i should be ashamed...

i was setting up classpath instead of path......

now... once and for all... i have changed the environment variable PATH... added java path to it....

thanks a lot for the help...
 
Let's get him boys! We'll make him read this tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic