diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 8a0052502..44cb895df 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -2355,14 +2355,16 @@ public class Base { // This works for Windows, Linux, and Apple's Java 6 on OS X. processingRoot = jarFolder.getParentFile(); } else if (Base.isMacOS()) { - // This works for Java 7 on OS X. + // This works for Java 7 on OS X. The 'lib' folder is not part of the + // classpath on OS X, and adding it creates more problems than it's + // worth. processingRoot = jarFolder; } if (processingRoot == null || !processingRoot.exists()) { // Try working directory instead (user.dir, different from user.home) - Base.log("Could not find lib folder via " + - jarFolder.getAbsolutePath() + - ", switching to user.dir"); + System.err.println("Could not find lib folder via " + + jarFolder.getAbsolutePath() + + ", switching to user.dir"); processingRoot = new File(System.getProperty("user.dir")); } } diff --git a/build/build-7u40.xml b/build/build-7u40.xml index 73b45d858..f8f2d19d3 100755 --- a/build/build-7u40.xml +++ b/build/build-7u40.xml @@ -408,7 +408,7 @@ - @@ -515,12 +515,6 @@ - - - diff --git a/build/macosx/appbundler/native/main.m b/build/macosx/appbundler/native/main.m index 5386ac60c..4a365e304 100644 --- a/build/macosx/appbundler/native/main.m +++ b/build/macosx/appbundler/native/main.m @@ -142,17 +142,21 @@ int launch(char *commandName) { // Set the class path NSString *mainBundlePath = [mainBundle bundlePath]; - NSString *javaPath = [mainBundlePath stringByAppendingString:@"/Contents/Java"]; - //NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@/Classes", javaPath]; + NSString *javaPath = + [mainBundlePath stringByAppendingString:@"/Contents/Java"]; + // Changed Contents/Java to the old Contents/Resources/Java [fry] + //[mainBundlePath stringByAppendingString:@"/Contents/Resources/Java"]; // Removed the /Classes, because the P5 compiler (ECJ?) will throw an - // error if it doesn't exist. But it's harmless to leave this as including - // the root dir, since it will always exist, and I guess if you wanted to - // put .class files in there, they'd work. If I knew more Cocoa, I'd just - // make this an empty string to start, to be appended a few lines later. + // error if it doesn't exist. But it's harmless to leave the root dir, + // since it will always exist, and I guess if you wanted to put .class + // files in there, they'd work. If I knew more Cocoa, I'd just make this + // an empty string to start, to be appended a few lines later. [fry] + //NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@/Classes", javaPath]; NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@", javaPath]; NSFileManager *defaultFileManager = [NSFileManager defaultManager]; - NSArray *javaDirectoryContents = [defaultFileManager contentsOfDirectoryAtPath:javaPath error:nil]; + NSArray *javaDirectoryContents = + [defaultFileManager contentsOfDirectoryAtPath:javaPath error:nil]; if (javaDirectoryContents == nil) { [[NSException exceptionWithName:@JAVA_LAUNCH_ERROR reason:NSLocalizedString(@"JavaDirectoryNotFound", @UNSPECIFIED_ERROR) @@ -165,6 +169,21 @@ int launch(char *commandName) { } } + /* + // search the 'lib' subfolder as well [fry] + NSString *libPath = + [mainBundlePath stringByAppendingString:@"/Contents/Resources/Java/lib"]; + NSArray *libDirectoryContents = + [defaultFileManager contentsOfDirectoryAtPath:libPath error:nil]; + if (libDirectoryContents != nil) { + for (NSString *file in libDirectoryContents) { + if ([file hasSuffix:@".jar"]) { + [classPath appendFormat:@":%@/%@", libPath, file]; + } + } + } + */ + // Set the library path NSString *libraryPath = [NSString stringWithFormat:@"-Djava.library.path=%@/Contents/MacOS", mainBundlePath]; diff --git a/build/macosx/appbundler/src/com/oracle/appbundler/AppBundlerTask.java b/build/macosx/appbundler/src/com/oracle/appbundler/AppBundlerTask.java index 349a794dc..9f5931412 100644 --- a/build/macosx/appbundler/src/com/oracle/appbundler/AppBundlerTask.java +++ b/build/macosx/appbundler/src/com/oracle/appbundler/AppBundlerTask.java @@ -330,6 +330,10 @@ public class AppBundlerTask extends Task { File resourcesDirectory = new File(contentsDirectory, "Resources"); resourcesDirectory.mkdir(); +// // Move back to Contents/Resources/Java instead of Contents/Java [fry] +// File javaDirectory = new File(resourcesDirectory, "Java"); +// javaDirectory.mkdir(); + // Generate Info.plist File infoPlistFile = new File(contentsDirectory, "Info.plist"); infoPlistFile.createNewFile(); diff --git a/todo.txt b/todo.txt index 746421b2c..3640a227f 100644 --- a/todo.txt +++ b/todo.txt @@ -2,6 +2,9 @@ X MovieMaker needs to be compiling as 1.6 X deal with null/missing folders for Tools and Modes X https://github.com/processing/processing/issues/2068 +o bad JS mode causing crash on startup +X https://github.com/processing/processing/issues/2088 +X looks like issue that was covered in 2.0.3 changes high _ remove video library for other platforms in download @@ -35,10 +38,11 @@ X the "Classes" folder is included X appears to be line 138 of main.m o maybe this is a holdover from OS X Java? don't know. _ icon location uses path, even when embedded -_ add indents to the Info.plist output file -_ inside writeInfoPlist from AppBundlerTask.java -_ use Contents/Resources/Java instead of Contents/Java? -_ this is in main.m. why the change? +X add indents to the Info.plist output file +X inside writeInfoPlist from AppBundlerTask.java +o use Contents/Resources/Java instead of Contents/Java? +o this is in main.m. why the change? +X doesn't make any difference, just use Contents/Java _ any missing args from our app (copyrights/versions?) _ make sure it's only running on 64-bit machines? _ add MinimumSystemVersion?