pmf
pmf

Reputation: 7749

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)?

Upvotes: 0

Views: 857

Answers (4)

SteveD
SteveD

Reputation: 5405

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.

Upvotes: 1

user101884
user101884

Reputation: 717

ant task to compile using osgi.

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

or here now I guess?

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

Upvotes: 3

djna
djna

Reputation: 55907

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.]

Upvotes: 0

Jay
Jay

Reputation: 5043

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

Upvotes: 1

Related Questions