views:

1222

answers:

3

My coworker noticed that when javac is compiling it only utilizes a single core. Is there anything like the -j command with the gcc for Java that will allow us to distribute the compiler workload across cores or processors? If not, do you think that this will ever be possible or is there some sort of fundamental restriction as a result of Java's design?

The environment is Linux with the Sun J2SE 1.6.0.11 jdk.

A: 

DataRush: http://www.pervasivedatarush.com/ may help you.

Amit
Does it come with its own implementation of the Java compiler? It isn't obvious from their site. That said - it looks like a cool tech that I want to look more into. Thanks!
Elijah
Its a Java library.
Amit
+6  A: 

You may find this blog useful: http://blogs.sun.com/jjg/entry/towards_a_multi_threaded_javac

Amit
+4  A: 

Although not exactly an answer to your question, some build environments like ant also support parallelization of builds, so if your dependency graph permits you can have multiple javac's running at the same time.

krosenvold
Regarding ant's parallel task: "It should be considered an advanced task which should be used in certain batch-processing or testing situations, rather than an easy trick to speed up build times on a multiway CPU" - http://ant.apache.org/manual/CoreTasks/parallel.html
Alex B