Skip to content

Commit 453529e

Browse files
committed
fix "Embed Java" for 32-bit Linux export
1 parent a2a1cc9 commit 453529e

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -693,21 +693,25 @@ protected boolean exportApplication() throws IOException, SketchException {
693693
Preferences.getBoolean("export.application.embed_java");
694694

695695
if (Preferences.getBoolean(JavaEditor.EXPORT_PREFIX + platformName)) {
696+
final int bits = Platform.getNativeBits();
697+
final String arch = Platform.getNativeArch();
698+
696699
if (Library.hasMultipleArch(platform, importedLibraries)) {
697700
// export the 32-bit version
698701
folder = new File(sketch.getFolder(), "application." + platformName + "32");
699-
if (!exportApplication(folder, platform, "32", embedJava && Platform.getNativeBits() == 32 && "x86".equals(Platform.getNativeArch()))) {
702+
703+
if (!exportApplication(folder, platform, "32", embedJava && (bits == 32) && ("x86".equals(arch) || "i386".equals(arch)))) {
700704
return false;
701705
}
702706
// export the 64-bit version
703707
folder = new File(sketch.getFolder(), "application." + platformName + "64");
704-
if (!exportApplication(folder, platform, "64", embedJava && Platform.getNativeBits() == 64 && "amd64".equals(Platform.getNativeArch()))) {
708+
if (!exportApplication(folder, platform, "64", embedJava && (bits == 64) && "amd64".equals(arch))) {
705709
return false;
706710
}
707711
if (platform == PConstants.LINUX) {
708712
// export the armv6hf version as well
709713
folder = new File(sketch.getFolder(), "application.linux-armv6hf");
710-
if (!exportApplication(folder, platform, "armv6hf", embedJava && Platform.getNativeBits() == 32 && "arm".equals(Platform.getNativeArch()))) {
714+
if (!exportApplication(folder, platform, "armv6hf", embedJava && (bits == 32) && "arm".equals(arch))) {
711715
return false;
712716
}
713717
}

todo.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ _ might be ext.dirs trouble with spaces in path names?
77
_ or the backwards slashes?
88
X fixes for Python Mode crashing on startup
99
X disable ext.dirs on Linux export and set jna.nosys as well
10+
X Java not included properly with 32-bit Linux export
1011
_ JavaInputHandler not registering
1112

1213
_ library compilations handled oddly

0 commit comments

Comments
 (0)