From 1efba6b431bec6c784935c3fa7b2cbaf0a3d7502 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 19 Oct 2013 16:24:03 -0400 Subject: [PATCH] update for JDK 7u45 on OS X, and prevent hard-coding of JDK version in Base --- app/src/processing/app/Base.java | 11 ++++++++++- build/build.xml | 30 +++++++----------------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 051bc9c1d..170fe5276 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -2405,7 +2405,16 @@ public class Base { static public String getJavaPath() { if (isMacOS()) { //return "Contents/PlugIns/jdk1.7.0_40.jdk/Contents/Home/jre/bin/java"; - return getContentFile("../PlugIns/jdk1.7.0_40.jdk/Contents/Home/jre/bin/java").getAbsolutePath(); + File[] plugins = getContentFile("../PlugIns").listFiles(new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.endsWith(".jdk") && dir.isDirectory(); + } + }); + //PApplet.printArray(plugins); + File javaBinary = new File(plugins[0], "Contents/Home/jre/bin/java"); + //return getContentFile(plugins[0].getAbsolutePath() + "/Contents/Home/jre/bin/java").getAbsolutePath(); + //return getContentFile("../PlugIns/jdk1.7.0_40.jdk/Contents/Home/jre/bin/java").getAbsolutePath(); + return javaBinary.getAbsolutePath(); } else if (isLinux()) { return getContentFile("java/bin/java").getAbsolutePath(); diff --git a/build/build.xml b/build/build.xml index 9def0cfe6..324fed312 100755 --- a/build/build.xml +++ b/build/build.xml @@ -151,30 +151,14 @@ - - - + + + - - - - - + + message="JDK 7u${jdk.update.macosx} required.${line.separator}To build on OS X, you must install Oracle's JDK 7u${jdk.update.macosx} from${line.separator}http://www.oracle.com/technetwork/java/javase/downloads${line.separator}Note that only 7u${jdk.update.macosx} (not a later or earlier version) will work. ${line.separator}And it must be the JDK, not the JRE. And do not try to defy me again." /> - + @@ -595,7 +579,7 @@ - +