开发者

Java Classpath problem

I have a class in another package. I'm trying to access that class by writing classpath header in command prompt with directory structure.

My question is why I'm not getting compile time error, because I've not开发者_StackOverflow社区 specified any jar file which is necessary to compile that java source file, as command prompt classpath header will override environment CLASSPATH variable.


Maybe Java is picking up the classpath from your environment settings.

If you are on windows do a set from the the command line and look for a CLASSPATH variable.

If you are on *nix do a env | grep -i classpath.

By default Java will look in the local directory (aka java -classpath .) but if the external classes are hidden away outside of your current directory then Java is probably picking them up from an environment variable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜