I use a desktop with eight cores to build a Java application using Ant (through a javac target). Is there a way to speed up the compilation by using more than one thread or
I assume that it might not help much because javac can pull all files in memory and if it has to do this with multiple processes it's just doubling the effort. However if you want to compile two fairly separate pieces of Java code, then you can just do:
#!/usr/bin/env bash
javac file1.java &
javac file2.java &
javac file3.java &
wait;
if the 3 files have mostly different dependencies, then it might save time, if the dependencies overlap, then it probably doesn't save much time.