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