Skip to content

Commit ff98113

Browse files
committed
JavaBuild: fix output path when java tabs have package declaration
1 parent cd4351e commit ff98113

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/src/processing/mode/java/JavaBuild.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,11 +523,11 @@ public String preprocess(File srcFolder,
523523
} else {
524524
if (packageMatch == null) {
525525
// use the default package name, since mixing with package-less code will break
526-
packageMatch = new String[] { packageName };
526+
packageMatch = new String[] { "", packageName };
527527
// add the package name to the source before writing it
528528
javaCode = "package " + packageName + ";" + javaCode;
529529
}
530-
File packageFolder = new File(srcFolder, packageMatch[0].replace('.', '/'));
530+
File packageFolder = new File(srcFolder, packageMatch[1].replace('.', File.separatorChar));
531531
packageFolder.mkdirs();
532532
Util.saveFile(javaCode, new File(packageFolder, filename));
533533
}

0 commit comments

Comments
 (0)