shelby
shelby

Reputation: 21

How does eclipse generate .class files with compilation errors?

I have a dynamic web project in eclipse, and to build we usually right click on the project > export as > war file. We then deploy the war file to a websphere server. The project has unresolved dependencies (Which are resolved later when we deploy onto the server) and so there are compilation errors in the eclipse UI, yet the .class files are still generated, and Eclipse will create a usable WAR file.

Using guidance from other questions (here, and here) I have tried partially compiling the .java files with the compilation errors into .class files using the eclipse compiler (ECJ), but the files generated using the command line just output the compilation error message into the .class file, instead of the actual executable bytecode like the eclipse UI produces.

Here's the code I'm running:

java -jar org.eclipse.jdt.core_3.12.3.v20170228-1205.jar -proceedOnError -classpath rt.jar .

The only Compilation errors that exist in the project are related to "the import *** cannot be resolved". Is there a way to generate these .class files on the command line in the same way they are generated automatically when using the eclipse UI?

Upvotes: 2

Views: 617

Answers (0)

Related Questions