Ant The Java task provides a parameter forkthat, by definition, "if enabled, starts class execution in another virtual machine." Since we are dealing with a lot of data, setting this parameter saved us from running out of Java heap space.We want to be able to do the same with the Java class. What would be the best way to achieve the functionality provided fork?
fork
Run another Java process. For example, using the ProcessBuilder class.
http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html
, . , , .
java- , .
, , Process.waitFor().
ant, fork - true, Execute, , ,
ant
true
Execute
Runtime.getRuntime().exec(cmd, env);
org.apache.tools.ant.taskdefs.Java org.apache.tools.ant.taskdefs.Execute ..
org.apache.tools.ant.taskdefs.Java
org.apache.tools.ant.taskdefs.Execute
I think you can directly use the Ant API ... Ant can be used directly in the Java class. Javadoc is available in its binary distribution.
Source: https://habr.com/ru/post/1708255/More articles:Correctly catch SecurityTokenException from WCF UserNamePasswordValidator - wcfHow to convert an arbitrary large integer from base 10 to base 16? - cIP address and country on the same line with AWK - bashWhy is the setting so that snapping the snap frame to the layer border is so weird? - iphoneОдин большой релиз или несколько небольших? - releaseJSP redirection: session loss issues - redirectMixing procedural and object-oriented programming - oophttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1708258/clr-stored-procedures-alternatives-to-sqlcontextpipesendresultsstart-sendresultsrow-sendresultsend&usg=ALkJrhiVmcJ9hcyDbU9E33TmAPmy5CzlpwProcess shaping in Java - javaInteractive 3D surface object - wpfAll Articles