Skip to content

Commit 2399d0d

Browse files
merksakurtakov
authored andcommitted
Ensure o.a.tools.ant.util FileUtils is initialized before JavaEnvUtils
eclipse-platform/eclipse.platform#2605
1 parent 2d7bc89 commit 2399d0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/core/JDTCompilerAdapter.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import org.apache.tools.ant.types.Commandline;
3333
import org.apache.tools.ant.types.Commandline.Argument;
3434
import org.apache.tools.ant.types.Path;
35+
import org.apache.tools.ant.util.FileUtils;
3536
import org.apache.tools.ant.util.JavaEnvUtils;
3637
import org.eclipse.jdt.core.compiler.CharOperation;
3738
import org.eclipse.jdt.internal.antadapter.AntAdapterMessages;
@@ -174,6 +175,9 @@ protected Commandline setupJavacCommand() throws BuildException {
174175
cmd.createArgument().setValue("-sourcepath"); //$NON-NLS-1$
175176
createClasspathArgument(cmd, sourcepath);
176177

178+
// There is a circularity problem if JavaEnvUtils is initialized before FileUtils on Windows
179+
// https://github.com/eclipse-platform/eclipse.platform/issues/2605
180+
FileUtils.getFileUtils();
177181
final String javaVersion = JavaEnvUtils.getJavaVersion();
178182
String memoryParameterPrefix = javaVersion.equals(JavaEnvUtils.JAVA_1_1) ? "-J-" : "-J-X";//$NON-NLS-1$//$NON-NLS-2$
179183
if (this.memoryInitialSize != null) {

0 commit comments

Comments
 (0)