开发者

Java Relative URL for URL class

I have 开发者_StackOverflow社区a file in my working project. It's in the current directory of source code.

Main
   -> src
       [packeges]
   -> plugin
        ->MyLib.jar
   -> other

I have a class in a packege of the src folder. Now I want to load the jar file to URL class like,

new URL("jar:file:/./plugin/MyLib.jar!/") // this relative file path is wrong

Could you please tell me what is the corrent relative path here?


I think that "." refers to the current directory of your binaries (*.class), not of your source code. Try create a url relative to your binaries.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜