开发者

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

开发者 https://www.devze.com 2023-03-09 05:45 出处:网络
What happens if a class (x.java) file exists both in th开发者_如何学Pythone current project and in the library it uses.

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

精彩评论

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