Skip to content

Commit 9f2f952

Browse files
committed
the Contents/Java switch ain't all that useful
1 parent 8c87878 commit 9f2f952

File tree

5 files changed

+45
-22
lines changed

5 files changed

+45
-22
lines changed

app/src/processing/app/Base.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2355,14 +2355,16 @@ static public File getContentFile(String name) {
23552355
// This works for Windows, Linux, and Apple's Java 6 on OS X.
23562356
processingRoot = jarFolder.getParentFile();
23572357
} else if (Base.isMacOS()) {
2358-
// This works for Java 7 on OS X.
2358+
// This works for Java 7 on OS X. The 'lib' folder is not part of the
2359+
// classpath on OS X, and adding it creates more problems than it's
2360+
// worth.
23592361
processingRoot = jarFolder;
23602362
}
23612363
if (processingRoot == null || !processingRoot.exists()) {
23622364
// Try working directory instead (user.dir, different from user.home)
2363-
Base.log("Could not find lib folder via " +
2364-
jarFolder.getAbsolutePath() +
2365-
", switching to user.dir");
2365+
System.err.println("Could not find lib folder via " +
2366+
jarFolder.getAbsolutePath() +
2367+
", switching to user.dir");
23662368
processingRoot = new File(System.getProperty("user.dir"));
23672369
}
23682370
}

build/build-7u40.xml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@
408408
409409
<chmod file="macosx/work/Processing.app/Contents/MacOS/JavaApplicationStub" perm="ugo+x" />
410410
411-
<copy todir="macosx/work/Processing.app/Contents/Resources/Java/lib"
411+
<copy todir="macosx/work/Processing.app/Contents/Java/lib"
412412
flatten="true">
413413
<fileset refid="runtime.jars"/>
414414
</copy>
@@ -515,12 +515,6 @@
515515
<delete file="processing.icns" />
516516
<delete file="pde.icns" />
517517

518-
<!-- Work around auto-included folder (from appbundler? or Oracle Java?)
519-
that causes the p5 Compiler to crash if it doesn't exist. -->
520-
<!--
521-
<mkdir dir="macosx/work/Processing.app/Contents/Java/Classes" />
522-
-->
523-
524518
<copy todir="macosx/work/Processing.app/Contents/Java">
525519
<fileset dir=".." includes="core/library/**" />
526520
<fileset dir="shared" includes="launch4j/**" />

build/macosx/appbundler/native/main.m

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,17 +142,21 @@ int launch(char *commandName) {
142142

143143
// Set the class path
144144
NSString *mainBundlePath = [mainBundle bundlePath];
145-
NSString *javaPath = [mainBundlePath stringByAppendingString:@"/Contents/Java"];
146-
//NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@/Classes", javaPath];
145+
NSString *javaPath =
146+
[mainBundlePath stringByAppendingString:@"/Contents/Java"];
147+
// Changed Contents/Java to the old Contents/Resources/Java [fry]
148+
//[mainBundlePath stringByAppendingString:@"/Contents/Resources/Java"];
147149
// Removed the /Classes, because the P5 compiler (ECJ?) will throw an
148-
// error if it doesn't exist. But it's harmless to leave this as including
149-
// the root dir, since it will always exist, and I guess if you wanted to
150-
// put .class files in there, they'd work. If I knew more Cocoa, I'd just
151-
// make this an empty string to start, to be appended a few lines later.
150+
// error if it doesn't exist. But it's harmless to leave the root dir,
151+
// since it will always exist, and I guess if you wanted to put .class
152+
// files in there, they'd work. If I knew more Cocoa, I'd just make this
153+
// an empty string to start, to be appended a few lines later. [fry]
154+
//NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@/Classes", javaPath];
152155
NSMutableString *classPath = [NSMutableString stringWithFormat:@"-Djava.class.path=%@", javaPath];
153156

154157
NSFileManager *defaultFileManager = [NSFileManager defaultManager];
155-
NSArray *javaDirectoryContents = [defaultFileManager contentsOfDirectoryAtPath:javaPath error:nil];
158+
NSArray *javaDirectoryContents =
159+
[defaultFileManager contentsOfDirectoryAtPath:javaPath error:nil];
156160
if (javaDirectoryContents == nil) {
157161
[[NSException exceptionWithName:@JAVA_LAUNCH_ERROR
158162
reason:NSLocalizedString(@"JavaDirectoryNotFound", @UNSPECIFIED_ERROR)
@@ -165,6 +169,21 @@ int launch(char *commandName) {
165169
}
166170
}
167171

172+
/*
173+
// search the 'lib' subfolder as well [fry]
174+
NSString *libPath =
175+
[mainBundlePath stringByAppendingString:@"/Contents/Resources/Java/lib"];
176+
NSArray *libDirectoryContents =
177+
[defaultFileManager contentsOfDirectoryAtPath:libPath error:nil];
178+
if (libDirectoryContents != nil) {
179+
for (NSString *file in libDirectoryContents) {
180+
if ([file hasSuffix:@".jar"]) {
181+
[classPath appendFormat:@":%@/%@", libPath, file];
182+
}
183+
}
184+
}
185+
*/
186+
168187
// Set the library path
169188
NSString *libraryPath = [NSString stringWithFormat:@"-Djava.library.path=%@/Contents/MacOS", mainBundlePath];
170189

build/macosx/appbundler/src/com/oracle/appbundler/AppBundlerTask.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,10 @@ public void execute() throws BuildException {
330330
File resourcesDirectory = new File(contentsDirectory, "Resources");
331331
resourcesDirectory.mkdir();
332332

333+
// // Move back to Contents/Resources/Java instead of Contents/Java [fry]
334+
// File javaDirectory = new File(resourcesDirectory, "Java");
335+
// javaDirectory.mkdir();
336+
333337
// Generate Info.plist
334338
File infoPlistFile = new File(contentsDirectory, "Info.plist");
335339
infoPlistFile.createNewFile();

todo.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
X MovieMaker needs to be compiling as 1.6
33
X deal with null/missing folders for Tools and Modes
44
X https://github.com/processing/processing/issues/2068
5+
o bad JS mode causing crash on startup
6+
X https://github.com/processing/processing/issues/2088
7+
X looks like issue that was covered in 2.0.3 changes
58

69
high
710
_ remove video library for other platforms in download
@@ -35,10 +38,11 @@ X the "Classes" folder is included
3538
X appears to be line 138 of main.m
3639
o maybe this is a holdover from OS X Java? don't know.
3740
_ icon location uses path, even when embedded
38-
_ add indents to the Info.plist output file
39-
_ inside writeInfoPlist from AppBundlerTask.java
40-
_ use Contents/Resources/Java instead of Contents/Java?
41-
_ this is in main.m. why the change?
41+
X add indents to the Info.plist output file
42+
X inside writeInfoPlist from AppBundlerTask.java
43+
o use Contents/Resources/Java instead of Contents/Java?
44+
o this is in main.m. why the change?
45+
X doesn't make any difference, just use Contents/Java
4246
_ any missing args from our app (copyrights/versions?)
4347
_ make sure it's only running on 64-bit machines?
4448
_ add MinimumSystemVersion?

0 commit comments

Comments
 (0)