Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassPath

 
Abhi vijay
Ranch Hand
Posts: 509
  • Mark post as helpful
  • send pies
  • 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.
 
Reehan Lalkhanwar
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Mourouganandame Arunachalam
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks a lot!
 
Campbell Ritchie
Sheriff
Pie
Posts: 48968
60
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic