gpt4 book ai didi

java - Java类如何从同一目录加载?

转载 作者:行者123 更新时间:2023-12-02 02:14:28 25 4
gpt4 key购买 nike

如果 lib 目录包含多个具有相同类的 JAR,使用类路径“lib/*”启动的 java 应用程序如何选择加载类?每次的行为都一样吗?使用不同的服务器?

最佳答案

来自the documentation :

The order in which the JAR files in a directory are enumerated in the expanded class path is not specified and may vary from platform to platform and even from moment to moment on the same machine. A well-constructed application should not depend upon any particular order. If a specific order is required, then the JAR files can be enumerated explicitly in the class path.

关于java - Java类如何从同一目录加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49500621/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com