Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make JavaC keep good class files when some input files are failing?

Tags:

java

javac

ant

When one compiles two independent java files with one javac call their class files are either

  1. both output to the output folder, on successful compile, or

  2. neither class file is output, if one source file contains some syntax or other error.

How can we make JavaC keep the good class file?

In other words, how can we make Javac to behave in a best effort way?

like image 222
mgaert Avatar asked Jan 25 '12 15:01

mgaert


1 Answers

I'd go with either:

  1. Batch multiple calls to javac
  2. Use another compiler, such as Eclipse's

As far as I can tell, the failOnError won't work as a flag for javac - only if you use Ant.

like image 96
Marcelo Avatar answered Oct 27 '22 15:10

Marcelo