Forums Register Login

ClassPath question

+Pie Number of slices to send: Send
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


+Pie Number of slices to send: Send
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.

Do you want ants? Because that's how you get ants. And a tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 701 times.
Similar Threads
Mock Exam Question Doubt, 36: 74 from K&B CD
Mock question on classpath
Classpaths
Another Error in Master Exam...
K&B Maste Exam Question on classpath
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 09:54:58.