Skip to content

Commit a56edfd

Browse files
committed
Fixed a bug to pass build directory to javax.tools compiler
1 parent 3709446 commit a56edfd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drjava/src/edu/rice/cs/drjava/model/compiler/JavaxToolsCompiler.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,16 @@ public List<? extends DJError> compile(List<? extends File> files, List<? extend
7474
optionList.add(sourceVersion);
7575
}
7676
if (destination != null) {
77-
optionList.add("-d");
78-
optionList.add(destination.getAbsolutePath());
77+
try {
78+
fileManager.setLocation(StandardLocation.CLASS_OUTPUT, Collections.singletonList(destination));
79+
} catch (IOException e) {
80+
List<DJError> errors = new ArrayList<>();
81+
errors.add(new DJError("Error setting build directory: " + e.getMessage(), false));
82+
return errors;
83+
}
84+
// This doesn't work for javax.tools compiler
85+
// optionList.add("-d");
86+
// optionList.add(destination.getAbsolutePath());
7987
}
8088

8189
// Prepare a diagnostic collector to collect compile errors

0 commit comments

Comments
 (0)