diff --git a/java/application/en.lproj/Localizable.strings b/java/application/en.lproj/Localizable.strings new file mode 100644 index 0000000000..b052770d6e --- /dev/null +++ b/java/application/en.lproj/Localizable.strings @@ -0,0 +1,7 @@ +"JRELoadError" = "Unable to load Java Runtime Environment."; +"JRExLoadError" = "Unable to load a Java %d Runtime Environment."; +"JRExLoadFullError" = "This application requires that Java %d or later be installed on your computer. Please download and install the latest version of Java from www.java.com and try again."; +"JDKxLoadFullError" = "This application requires that a Java %d JDK or later be installed on your computer. Please download and install the latest Java JDK from Oracle.com and try again."; +"MainClassNameRequired" = "Main class name is required."; +"JavaDirectoryNotFound" = "Unable to enumerate Java directory contents."; +"BundlePathContainsColon" = "Cannot launch from folder that contains a \"/\" in its name."; diff --git a/java/src/processing/mode/java/JavaBuild.java b/java/src/processing/mode/java/JavaBuild.java index d9aeb5b4dc..68a81eabb4 100644 --- a/java/src/processing/mode/java/JavaBuild.java +++ b/java/src/processing/mode/java/JavaBuild.java @@ -24,6 +24,7 @@ package processing.mode.java; import java.io.*; +import java.nio.file.Files; import java.util.*; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -732,7 +733,8 @@ protected boolean exportApplication(File destFolder, writer.println("APPL????"); writer.flush(); writer.close(); - if(System.getProperty("compose.application.resources.dir") == null) { + var resources = System.getProperty("compose.application.resources.dir"); + if(resources == null) { // Use faster(?) native copy here (also to do sym links) if (embedJava) { Util.copyDirNative(new File(contentsOrig, "PlugIns"), @@ -744,6 +746,29 @@ protected boolean exportApplication(File destFolder, new File(resourcesFolder, "en.lproj")); Util.copyFile(mode.getContentFile("application/application.icns"), new File(resourcesFolder, "application.icns")); + }else{ + if(embedJava){ + try { + var jdk = Files.list(new File(resources).toPath()) + .filter(Files::isDirectory) + .filter(p -> p.getFileName().toString().startsWith("jdk-")) + .findFirst() + .orElseThrow(); + var target = new File(contentsFolder, "PlugIns/"); + target.mkdirs(); + Util.copyDirNative(jdk.toFile(), target); + } catch (IOException e) { + e.printStackTrace(); + } + + Util.copyDir(new File(resources, "modes/java/application/en.lproj"), + new File(contentsFolder, "Resources/en.lproj")); + Util.copyFile(new File(resources, "modes/java/application/application.icns"), + new File(contentsFolder, "Resources/application.icns")); + + + } + } // TODO: Handle the java embed and Icon with the new build system