1
A
回答
0
在其classpath。
在应用程序服务器上,通常设置了很多路径。通常,您可以检查启动日志或登录以下属性的值,以确定其寻找:
System.getProperty("java.class.path")
+0
..这是不适用于本地库。 – 2011-05-25 14:19:31
0
http://en.wikipedia.org/wiki/Classpath_%28Java%29
**虚拟机搜索和加载类的顺序如下:
bootstrap classes: the classes that are fundamental to the Java Platform (comprising the public classes of the Java Class Library, and the private classes that are necessary for this library to be functional).
extension classes: packages that are in the extension directory of the JRE or JDK, jre/lib/ext/
user-defined packages and libraries
**
+0
为什么?你想复制和粘贴从维基百科?我刚刚给你的源 – anfy2002us 2011-05-25 14:18:50
1
它看起来几个不同的地方,如其他答案建议。您可以使用System.getProperty("java.library.path")
或System.getProperty("java.class.path")
来查看实际路径。
下面的代码我也发现很有用。您可以使用它在运行时添加搜索到的库路径的路径。
/**
* Allows you to add a path to the library path during runtime
* @param dllLocation The path you would like to add
* @return True if the operation completed successfully, false otherwise
*/
public boolean addDllLocationToPath(final String dllLocation)
{
//our return value
boolean retVal = false;
try
{
System.setProperty("java.library.path", System.getProperty("java.library.path") + ";" + dllLocation);
//get the sys path field
Field fieldSysPath = ClassLoader.class.getDeclaredField("sys_paths");
fieldSysPath.setAccessible(true);
fieldSysPath.set(null, null);
retVal = true;
}
catch (Exception e)
{
System.err.println("Could not modify path");
}
return retVal;
}
相关问题
- 1. 查找路径
- 2. Java - 查找文件的绝对路径
- 3. 使用DFS和java的路径查找
- 4. RaphaelJS库查找路径的交点
- 5. 查找给定路径的根路径
- 6. 运行java路径查找器
- 7. 在nltk.tree.Tree中查找路径
- 8. CMake在错误路径上查找库
- 9. 找到Delphi的Java路径
- 10. 查找与路径
- 11. ProGuard的Java库路径
- 12. 在java中使用java查找路径算法
- 13. 查找矩阵中的最短路径
- 14. 查找DLV中的最短路径
- 15. 多维数组中的路径查找
- 16. C中的路径查找算法
- 17. 查找系统路径中的所有Java版本
- 18. Java库路径问题
- 19. 在Linux中查找静态系统库的路径
- 20. 最短路径查找器
- 21. 查找文件路径
- 22. 查找绝对路径
- 23. 如何查找UIImageView路径
- 24. A *查找路径无效
- 25. 查找文件路径
- 26. MSBuild查找工具路径
- 27. 查找本地路径getUnlockedImageUri
- 28. Java:从注册表中查找安装路径
- 29. 查找矩阵中是否有路径?
- 30. 在AR环境中查找路径
更具体一点,请问:什么是*项目*,什么是*部署*,在您的问题的背景下! – 2011-05-25 14:17:14
不,这个问题应该以通用的方式回答,这适用于99%的开发应用程序! – Stefan 2011-05-25 14:41:06
更精确:*在J2EE上下文中* project *和* deploy *与在简单的Java应用程序或applet中执行相同的操作不同。 * project *可能是一个IDE相关术语(如:eclipse项目)。 – 2011-05-25 14:44:28