Adding plugin.jar to the build path in eclipse in a machine indepenent way
I'm working on a project that uses JSObject from the jre's plugin.jar, which isn't included in the build path normally. I can get things to compile fine by adding the jar to the classpath. Currently I'm doing this in eclipse via Project->Configure Build Path->Libraries->Add External JARs... -> find the jar in jdk/jre/lib/plugin.jar. This results in a machine specific path in my .classpath file (like C:/Program Files/Java/jdk1.6.0_16/jre/lib/plugin.jar). Checking this into our repository obviously breaks the build for developers with different Java install paths or non-windows operating systems. Is there a way to add jars from the system library using relative paths?
I don't know if it's the "right way", but I solve this by creating a named "user" library, like "LIVE_CONNECT", whose sole content is the plugin.jar. Each developer will still have to configure their own workspace to have such a user library, but at least it will kind of document itself!
链接地址: http://www.djcxy.com/p/73836.html上一篇: Java获得可用内存(eclipse)