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. 查找路径
- 3. 使用DFS和java的路径查找
- 4. Java - 查找文件的绝对路径
- 5. RaphaelJS库查找路径的交点
- 6. Java数据库路径找不到
- 7. 查找给定路径的根路径
- 8. 运行java路径查找器
- 9. 在nltk.tree.Tree中查找路径
- 10. CMake在错误路径上查找库
- 11. 找到Delphi的Java路径
- 12. 查找与路径
- 13. ProGuard的Java库路径
- 14. 获取库的路径 - Java
- 15. 查找PenDrive的路径
- 16. Django的查找路径setting.py
- 17. 在java中使用java查找路径算法
- 18. 多维数组中的路径查找
- 19. 查找矩阵中的最短路径
- 20. postgres中的递归路径查找
- 21. 查找DLV中的最短路径
- 22. Linux中的路径名称查找?
- 23. 查找网格中的路径故障
- 24. C中的路径查找算法
- 25. 查找系统路径中的所有Java版本
- 26. Java类路径库(jar)
- 27. Java库路径问题
- 28. Xuggle和java库路径
- 29. 在Unix系统中查找用户主库的绝对路径
- 30. 在Linux中查找静态系统库的路径
更具体一点,请问:什么是*项目*,什么是*部署*,在您的问题的背景下! – 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