2013-11-24 40 views
0

我在Oracle文檔上通過了URL API。我想構建URI來指代位於遠程機器上的Jars,但是從規格說明我無法知道如何使用它們。該文件提供了參考RFC2396的規格。但是,這也沒有提供任何具體的使用例子。如何使用Oracle文檔構建URI

+0

是指在C/C++語言解析的String。 – NEO

+0

目前還不清楚你在問什麼。您是否嘗試使用遠程類加載(從Web服務器或類似地址下載jar,然後在正在運行的程序中使用它)? – chrylis

+0

看看這個問題:http://stackoverflow.com/questions/14247716/remote-jars-in-the-classpath – Dave

回答

0

下面的代碼是@戴夫你所提供的鏈接,罐子裝有用

Method method = URLClassLoader.class.getDeclaredMethod("addURL", new Class[]{URL.class}); 
method.setAccessible(true); 
method.invoke(ClassLoader.getSystemClassLoader(), new Object[]{new URL("http://somewhere.net/library.jar")}); 
Class.forName("your.remote.ClassName");