Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions java/src/processing/mode/java/Compiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ static public boolean compile(JavaBuild build) throws SketchException {
//"-noExit", // not necessary for ecj
"-source", "1.7",
"-target", "1.7",
"-encoding", "utf8",
"-classpath", build.getClassPath(),
"-nowarn", // we're not currently interested in warnings (works in ecj)
"-d", build.getBinFolder().getAbsolutePath() // output the classes in the buildPath
Expand Down
9 changes: 6 additions & 3 deletions java/src/processing/mode/java/JavaBuild.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
package processing.mode.java;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.HashMap;
Expand Down Expand Up @@ -249,14 +251,15 @@ public String preprocess(File srcFolder,
outputFolder.mkdirs();
// Base.openFolder(outputFolder);
final File java = new File(outputFolder, sketch.getName() + ".java");
final PrintWriter stream = new PrintWriter(new FileWriter(java));
BufferedWriter bw = Files.newBufferedWriter(java.toPath(), StandardCharsets.UTF_8);
final PrintWriter stream = new PrintWriter(bw);
try {
result = preprocessor.write(stream, bigCode.toString(), codeFolderPackages);
} finally {
stream.close();
}
} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
String msg = "Build folder disappeared or could not be written";
throw new SketchException(msg);

Expand Down