简体   繁体   中英

Are there any Java-compilers that leverage an OSGi-environment instead of using the classpath?

Are there any ways to make javac use an existing OSGi-environment for the resolution of build-time dependencies instead of setting the classpath explicitely? I know I could write an OSGi-component that uses the Compiler-API of the JDK, but I think there should be a more straightforward solution.

Alternatively, if no such extension is available for javac , does ejc allow such a thing (usable from the command line; I'd be willing to accept an Equinox-only solution with ejc )?

ant task to compile using osgi.

http://www.ohloh.net/p/osgijc

or here now I guess?

http://code.google.com/p/eclipseosgitools/

Have you considered using Maven to manage dependencies? There are plugins available for IDEs like Eclipse. You just need to map the resource servers, and the needed libraries in a pom.xml, and that is pretty much it.

-Jay

You're missing out on the one obvious Java compiler that follows OSGi rules - Eclipse.

You can use Eclipse's compiler to do a headless build, but be warned, it's not for the faint-hearted.

Here's a simple tutorial on building with Eclipse and ant.

If you go down this path, I'd suggest looking at Tycho (the Maven sub-project for building OSGi stuff) and Buckminster , an Eclipse project.

I'm developing in the Lotus Expeditor Toolkit and Eclipse Plugin - It's a no-charge download. My build time and runtime classpaths are managed very easily by entries in the Manifests.

[disclaimer: I am an IBM employee.]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM