• Post Reply Bookmark Topic Watch Topic
  • New Topic

class path error  RSS feed

 
srinivas ekam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im unable to create classes in different floder(javac -d ../classes ProgramName.java).I Receive error as'javac:invalid flag:ud usage:javac <options><source files>'.But when i try to compile in the same folder the class file is created
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Can you paste the exact command you are trying?
 
Campbell Ritchie
Marshal
Posts: 56520
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch (again)
Please also tell us what happens when you write echo $CLASSPATH (*nix) or echo %CLASSPATH% (Windows®)
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If you are using cmd prompt in Windows, then try using only single dot like below
javac -d ./class class/john.java
 
srinivas ekam
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

im using cmd prompt in Windows 7,I tried using javac -d ./class/ProgramName.java,still i received the same error as 'javac:invalid flag:ud usage:javac <options><source files>'.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
srinivas ekam wrote:javac -d ./class/ProgramName.java

in this command there is no folder specified to create the class file. Include it like javac -d ./class/Folder ./class/ProgramName.java
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!