• 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

ClassPath

 
Ranch Hand
Posts: 509
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CLASSPATH:
C:\Program Files\Java\jdk1.6.0_04\bin\Myproject\Source

Now, I have created a directory named Myproject inside bin. Myproject contains 2 directories Source and Classes. But the command prompt says javac not a valid command inside Source. What changes should I make in the Classpath.Please help.
 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Set PATH to C:\Program Files\Java\jdk1.6.0_04\bin.
Make sure that C:\Program Files\Java\jdk1.6.0_04\bin contains the *.exe files i.e. java, javac etc.
 
Abhi vijay
Ranch Hand
Posts: 509
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But javac is a valid command in bin.I am able to compile files in bin.But unable to compile files in Myproject directory which is located inside bin.
 
Ranch Hand
Posts: 398
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Abhi,

As stated above, if you want to access java or javac from other than bin folder, the "bin" folder should be added in the "path" variable. So, before using javac for the first time, use the following command in your command prompt:

C:\Program Files\Java\jdk1.6.0_04\bin\Myproject\Source>set path=%path%;C:\Program Files\Java\jdk1.6.0_04\bin;

C:\Program Files\Java\jdk1.6.0_04\bin\Myproject\Source>javac <<your java program name>>

Please note, your project folder need not to be inside java installation folder under bin. You can have your project folder somewhere in any of your valid drives (for example c:\Myproject) to make it simple to access.

Hope this helps.

Mourougan
[ December 01, 2008: Message edited by: Mourouganandame Arunachalam ]
 
Abhi vijay
Ranch Hand
Posts: 509
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot!
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Mourouganandame Arunachalam:
Hi Abhi,
Please note, your project folder need not to be inside java installation folder under bin. . . .



A useful piece of advice. In fact you should always create a Java folder somewhere.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic