From c4faf2dc285a080f6a96efe0a59b305817f5ba57 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 31 Oct 2011 23:45:44 +0000 Subject: [PATCH] moving to Java 1.6 requirement, also add -d32/64 for exports, other misc --- app/src/processing/app/Base.java | 10 +---- app/src/processing/mode/java/JavaBuild.java | 10 +++++ build/macosx/template.app/Contents/Info.plist | 10 +---- build/shared/revisions.txt | 16 ++++++++ build/windows/export/launcher.cpp | 38 +++++++++++++++++++ build/windows/launcher/config.xml | 2 +- java/application/template.plist | 19 ++-------- todo.txt | 5 +++ 8 files changed, 78 insertions(+), 32 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 6aa52d536..a710de57f 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -310,12 +310,10 @@ public class Base { try { Class.forName("com.sun.jdi.VirtualMachine"); } catch (ClassNotFoundException cnfe) { - //Base.showPlatforms(); - //static public void showPlatforms() { Base.openURL("http://wiki.processing.org/w/Supported_Platforms"); - Base.showError("Please install JDK 1.5 or later", + Base.showError("Please install JDK 1.6 or later", "Processing requires a full JDK (not just a JRE)\n" + - "to run. Please install JDK 1.5 or later.\n" + + "to run. Please install JDK 1.6 or later.\n" + "More information can be found in the reference.", cnfe); } } @@ -373,7 +371,6 @@ public class Base { libraryManagerFrame = new ContributionManagerDialog("Library Manager", new ContributionListing.Filter() { - public boolean matches(Contribution contrib) { return contrib.getType() == Contribution.Type.LIBRARY || contrib.getType() == Contribution.Type.LIBRARY_COMPILATION; @@ -381,21 +378,18 @@ public class Base { }); toolManagerFrame = new ContributionManagerDialog("Tool Manager", new ContributionListing.Filter() { - public boolean matches(Contribution contrib) { return contrib.getType() == Contribution.Type.TOOL; } }); modeManagerFrame = new ContributionManagerDialog("Mode Manager", new ContributionListing.Filter() { - public boolean matches(Contribution contrib) { return contrib.getType() == Contribution.Type.MODE; } }); updateManagerFrame = new ContributionManagerDialog("Update Manager", new ContributionListing.Filter() { - public boolean matches(Contribution contrib) { if (contrib instanceof InstalledContribution) { return ContributionListing.getInstance().hasUpdates(contrib); diff --git a/app/src/processing/mode/java/JavaBuild.java b/app/src/processing/mode/java/JavaBuild.java index 4713686d7..6ab9edd31 100644 --- a/app/src/processing/mode/java/JavaBuild.java +++ b/app/src/processing/mode/java/JavaBuild.java @@ -1325,6 +1325,16 @@ public class JavaBuild { runOptions += " -Xmx" + Preferences.get("run.options.memory.maximum") + "m"; } + if (exportPlatform == PConstants.MACOSX) { + // If no bits specified (libs are all universal, or no native libs) + // then exportBits will be 0, and can be controlled via "Get Info". + // Otherwise, need to specify the bits as a VM option. + if (exportBits == 32) { + runOptions += " -d32"; + } else if (exportBits == 64) { + runOptions += " -d64"; + } + } /// macosx: write out Info.plist (template for classpath, etc) diff --git a/build/macosx/template.app/Contents/Info.plist b/build/macosx/template.app/Contents/Info.plist index 9fcce45b1..b11709a10 100755 --- a/build/macosx/template.app/Contents/Info.plist +++ b/build/macosx/template.app/Contents/Info.plist @@ -69,8 +69,9 @@ MainClass processing.app.Base + JVMVersion - 1.5+ + 1.6* ClassPath $JAVAROOT/pde.jar:$JAVAROOT/core.jar:$JAVAROOT/ant.jar:$JAVAROOT/ant-launcher.jar:$JAVAROOT/antlr.jar:$JAVAROOT/ecj.jar:$JAVAROOT/jna.jar:$JAVAROOT/quaqua.jar - JVMArchs - - - i386 - ppc - - Properties diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 67a3270c7..39a0c72b5 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,3 +1,19 @@ +PROCESSING 2.0a2 (REV 0201) - 31 October 2011 + +Happy Halloween! I'll be dressing up as an ArrayIndexOutOfBoundsException. + +This release is primarily focused on the new video library and making it +usable across platforms. It also has some changes for how applications +are exported, and a number of other bug fixes and tweaks. + +[ about those changes ] + + + + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + + PROCESSING 2.0a1 (REV 0200) - 2 September 2011 First alpha release as we head toward 2.0. Please read the changes page diff --git a/build/windows/export/launcher.cpp b/build/windows/export/launcher.cpp index 85cbed035..dfb311165 100644 --- a/build/windows/export/launcher.cpp +++ b/build/windows/export/launcher.cpp @@ -308,6 +308,7 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) strcpy(executable, "javaw.exe"); } + /* SHELLEXECUTEINFO ShExecInfo; //MessageBox(NULL, executable, outgoing_cmd_line, MB_OK); @@ -352,7 +353,44 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow) break; } } + return 0; + */ + + PROCESS_INFORMATION pi; + memset(&pi, 0, sizeof(pi)); + STARTUPINFO si; + memset(&si, 0, sizeof(si)); + si.cb = sizeof(si); + int wait = 0; + + DWORD dwExitCode = -1; + char cmdline[32768]; + //executable; + //outgoing_cmd_line; + //exe_directory; + strcpy(cmdline, "\""); + strcat(cmdline, executable); + strcat(cmdline, "\" "); + strcat(cmdline, outgoing_cmd_line); + + if (CreateProcess(NULL, cmdline, NULL, NULL, + //TRUE, priority, NULL, NULL, + TRUE, 0, NULL, exe_directory, + &si, &pi)) { + if (wait) { + WaitForSingleObject(pi.hProcess, INFINITE); + GetExitCodeProcess(pi.hProcess, &dwExitCode); + //debug("Exit code:\t%d\n", dwExitCode); + //closeHandles(); + char[128] big_trouble; + sprintf(big_trouble, "Sorry, could not launch. (Error %d)", dwExitCode); + MessageBox(NULL, big_trouble, "Apologies", MB_OK); + } else { + dwExitCode = 0; + } + } + return dwExitCode; } diff --git a/build/windows/launcher/config.xml b/build/windows/launcher/config.xml index 4358c1968..4efd2dc29 100755 --- a/build/windows/launcher/config.xml +++ b/build/windows/launcher/config.xml @@ -25,7 +25,7 @@ java - 1.5.0 + 1.6.0 jdkOnly -Xms128m -Xmx128m diff --git a/java/application/template.plist b/java/application/template.plist index fb10ceb70..cbb988129 100755 --- a/java/application/template.plist +++ b/java/application/template.plist @@ -27,28 +27,17 @@ LSUIPresentationMode @@lsuipresentationmode@@ - - LSArchitecturePriority - - i386 - ppc - - Java VMOptions @@vmoptions@@ + MainClass @@sketch@@ + JVMVersion - 1.5* - JVMArchs - - i386 - ppc - + 1.6* + ClassPath @@classpath@@ diff --git a/todo.txt b/todo.txt index 0c27839d9..c4af3f086 100644 --- a/todo.txt +++ b/todo.txt @@ -10,6 +10,11 @@ X on Windows, move the exported DLLs et al inside 'lib' X requires change to export/launcher.cpp to include the exe dir _ this will cause trouble with ... X change Linux script to handle the 'lib' dir as part of the lib path +X changed Mac OS X launchers, also requiring Java 1.6. + + // If no bits specified (libs are all universal, or no native libs) + // then exportBits will be 0, and can be controlled via "Get Info". + // Otherwise, need to specify the bits as a VM option. _ add a preferences option for whether to run in 32 or 64-bit _ also make note of when library is not available (serial) with error msg