Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does fork="true" do?

Tags:

ant

I saw the attribute fork="true" in an ant <java> task. What does it mean?

like image 553
user496949 Avatar asked Feb 25 '11 03:02

user496949


1 Answers

It causes the task to run in a different process, and a different Java virtual machine. From the docs:

fork: if enabled triggers the class execution in another VM (disabled by default)

Why this is useful: Some behavior and parameters require a separate JVM, run in a separate process. For example, your task might need a different classpath, more memory, or different JVM arguments. You might want the build to continue if the task fails or crashes. You might want to specify a timeout for the task.

like image 182
Andy Thomas Avatar answered Nov 25 '22 19:11

Andy Thomas