wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes ClassPath question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "ClassPath question" Watch "ClassPath question" New topic

ClassPath question

Rachel Glenn
Ranch Hand

Joined: Oct 24, 2012
Posts: 95
Suppose I have the following:


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

Joined: Jul 29, 2012
Posts: 721
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.

I agree. Here's the link: http://aspose.com/file-tools
subject: ClassPath question
Similar Threads
Mock question on classpath
Another Error in Master Exam...
K&B Maste Exam Question on classpath
Mock Exam Question Doubt, 36: 74 from K&B CD