开发者

How to see full compile path in Eclipse?

开发者 https://www.devze.com 2023-01-03 21:59 出处:网络
I have looked for an answer for this nearly every where that I can think of, but there doesn\'t seem to be any way to actually SEE what Eclipse \"runs\" to compile the projects (as it does need the JD

I have looked for an answer for this nearly every where that I can think of, but there doesn't seem to be any way to actually SEE what Eclipse "runs" to compile the projects (as it does need the JDK installed and visible to actually build). I ask because I imported a few jars into my project, and even though I've looked through all the javac documentation, I can't seem to figure out how to mimic it quite like Eclipse does. I really, really need to be able to compile on the command line in this case - Eclipse or any other IDE just isn't what is needed.

I started to look through the Eclipse source, and although this sounds lazy, I just became overwhelmed and figured I would ask he开发者_如何学Cre first, hoping someone else had the same question at one point.


Eclipse JDT does not require the JDK and does not use javac - it uses it's own compiler.

You can see the classpath by reading your project .classpath file. The various builders that are used to perform build operations (Java, or whatever the project builds) are listed in the .project file. (These are also listed in the project settings.)

It is possible to invoke Eclipse to build your project in headless mode, or write Ant scripts that can be executed both with the JDK and within Eclipse, or install Maven support for internal and external building. It is also possible to configure the project builders to rely only on external tools.


Look at these two articles.
http://www.eclipse.org/articles/Article-Builders/builders.html
http://www.eclipsepluginsite.com/builders-natures-markers.html

Look at your .classpath file and start building an ANT build.xml. You need to do this to be able to have consistent builds on a build machine anyways. It is unlikely that a build server would have eclipse installed on it anyways.

Maven is also another tool that is used for builds. In our shop we use Ant.


Have a look at ant4eclipse - this project allows for generating the appropriate ant data structures for invoking <javac> from the .classpath files and a projectSet.psf file.

By using this we can use Eclipse "natively" and bend ant to conform to Eclipse. The usual approach is the other way around.

0

精彩评论

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