开发者

Eclipse = What happens if a class is included in project and library

What happens if a class (x.java) file exists both in th开发者_如何学Pythone current project and in the library it uses. Which one will it take?


It should be the one first loaded by the order defined in Project Properties->Java Build Path->Order and Export.


The projects binaries should come first.

System.out.println(System.getProperty("java.class.path");

prints the current classpath to the console - in my case, the projects bin folder is the first entry, followed by the projects libraries.


Note - with the above statement I can confirm zeropages answer. Changing the projects properties ("Order and export") changes the classpath which can be verified through the above statement.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜