1s2a3n4j5e6e7v
1s2a3n4j5e6e7v

Reputation: 1259

Accessing Java Packages in different Drives

Consider if I have got a Package in my C:\x\y\z and another package in D:\m\n\o. How can I access them in my java program? Do I need to set any path?

Upvotes: 3

Views: 1106

Answers (1)

skaffman
skaffman

Reputation: 403471

You need to set your classpath to add each directory. Assuming that your package structure begins underneath each of those directories:

java -classpath C:\x\y\z;D:\m\n\o <MyClassName>

See docs.

Upvotes: 7

Related Questions