File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassPath question

 
Rachel Glenn
Ranch Hand
Posts: 95
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Suppose I have the following:

/mp/classes/player/musicplayer.class

and the current directory is set to /mp.

Why isn't the following invocation a valid way to run musicplayer.class ??

>> java -cp /mp/classes/player musicplayer


 
Himai Minh
Ranch Hand
Posts: 1142
4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this
>> java /mp/classes/player/musicplayer

If your main method is in musicplayer.java, java will look for it through the path you provide.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic