Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring back 10.6 builds? #3

Closed
dakrone opened this issue Jan 10, 2013 · 23 comments
Closed

Bring back 10.6 builds? #3

dakrone opened this issue Jan 10, 2013 · 23 comments

Comments

@dakrone
Copy link

@dakrone dakrone commented Jan 10, 2013

Part of the draw for using the pre-built OpenJDK builds was that I could use JDK 7 on OSX 10.6 (Since Oracle doesn't support it).

Now that the downloads are gone, and the build instructions require Lion or Mountain Lion, I cannot use JDK 7.

Would it be possible to publish instructions for building on 10.6?

@hgomez
Copy link
Owner

@hgomez hgomez commented Jan 11, 2013

I don't have OSX machine anymore.
What didn't works with build ?

Le 10 janv. 2013 à 18:36, Lee Hinman notifications@github.com a écrit :

Part of the draw for using the pre-built OpenJDK builds was that I could use JDK 7 on OSX 10.6 (Since Oracle doesn't support it).

Now that the downloads are gone, and the build instructions require Lion or Mountain Lion, I cannot use JDK 7.

Would it be possible to publish instructions for building on 10.6?


Reply to this email directly or view it on GitHub.

@dakrone
Copy link
Author

@dakrone dakrone commented Jan 11, 2013

The first commands with xcode-select don't work (nor am I able to use the correct version of XCode since the two that are mentioned are you Mountain Lion and Lion).

If I run the build anyway, I get this error:

/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '-[AWTView resizeWithOldSuperviewSize:]':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: 'AWTView' may not respond to '-deliverResize:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: (Messages without a matching method signature
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: will be assumed to return 'id' and accept
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: '...' as arguments.)
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetNSViewDisplayID_block_invoke_1':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1308: warning: 'AWTWindow' may not respond to '+getNSWindowDisplayID_AppKitThread:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen_block_invoke_1':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338: warning: 'NSWindow' may not respond to '-convertRectToScreen:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338: error: incompatible types in assignment
make[5]: *** [/Users/hinmanm/openjdkathome/sources/openjdk7/build/macosx-x86_64/tmp/sun/sun.lwawt/lwawt/obj64/AWTView.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [library_parallel_compile] Error 2
make[3]: *** [all] Error 1
make[2]: *** [all] Error 1
make[1]: *** [jdk-build] Error 2
make: *** [build_product_image] Error 2
can't find java into JDK /Users/hinmanm/openjdkathome/sources/openjdk7/build/macosx-x86_64/j2sdk-image, build failed
XBUILD=true ./obuildfactory/openjdk7/macosx/standalone-job.sh  2486.22s user 342.61s system 182% cpu 25:51.14 total
@hgomez
Copy link
Owner

@hgomez hgomez commented Jan 11, 2013

SnowLeopard 32 or 64bits ?

XCode version ?

AWTWindow' may not respond to '+getNSWindowDisplayID_AppKitThread:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:
In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen_block_invoke_1':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338:
warning: 'NSWindow' may not respond to '-convertRectToScreen:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338:
error: incompatible types in assignment
make[5]: *** [/Users/hinmanm/openjdkathome/sources/openjdk7/build/macosx-x86_64/tmp/sun/sun.lwawt/lwawt/obj64

Oracle (and Apple), don't support Snow, so may be it's a missing
dependency in Snow ;(
As I said, I don't have OSX machine anymore so I can't help your more,
especially with Snow since I was using ML before leaving OSX world.

2013/1/11 Lee Hinman notifications@github.com

The first commands with xcode-select don't work (nor am I able to use the
correct version of XCode since the two that are mentioned are you Mountain
Lion and Lion).

If I run the build anyway, I get this error:

/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '-[AWTView resizeWithOldSuperviewSize:]':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: 'AWTView' may not respond to '-deliverResize:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: (Messages without a matching method signature
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: will be assumed to return 'id' and accept
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: '...' as arguments.)
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetNSViewDisplayID_block_invoke_1':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1308: warning: 'AWTWindow' may not respond to '+getNSWindowDisplayID_AppKitThread:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen_block_invoke_1':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338: warning: 'NSWindow' may not respond to '-convertRectToScreen:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338: error: incompatible types in assignment
make[5]: *** [/Users/hinmanm/openjdkathome/sources/openjdk7/build/macosx-x86_64/tmp/sun/sun.lwawt/lwawt/obj64/AWTView.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [library_parallel_compile] Error 2
make[3]: *** [all] Error 1
make[2]: *** [all] Error 1
make[1]: *** [jdk-build] Error 2
make: *** [build_product_image] Error 2
can't find java into JDK /Users/hinmanm/openjdkathome/sources/openjdk7/build/macosx-x86_64/j2sdk-image, build failed
XBUILD=true ./obuildfactory/openjdk7/macosx/standalone-job.sh 2486.22s user 342.61s system 182% cpu 25:51.14 total


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-12150747.

@hgomez
Copy link
Owner

@hgomez hgomez commented Jan 11, 2013

I suggest you to post a message to openjdk macosx list but I'm unsure
you'll get reply there since Snow is not a supported platform ;(

2013/1/11 Henri Gomez henri.gomez@gmail.com

SnowLeopard 32 or 64bits ?

XCode version ?

AWTWindow' may not respond to '+getNSWindowDisplayID_AppKitThread:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen_block_invoke_1':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338: warning: 'NSWindow' may not respond to '-convertRectToScreen:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338: error: incompatible types in assignment
make[5]: *** [/Users/hinmanm/openjdkathome/sources/openjdk7/build/macosx-x86_64/tmp/sun/sun.lwawt/lwawt/obj64

Oracle (and Apple), don't support Snow, so may be it's a missing
dependency in Snow ;(
As I said, I don't have OSX machine anymore so I can't help your more,
especially with Snow since I was using ML before leaving OSX world.

2013/1/11 Lee Hinman notifications@github.com

The first commands with xcode-select don't work (nor am I able to use
the correct version of XCode since the two that are mentioned are you
Mountain Lion and Lion).

If I run the build anyway, I get this error:

/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '-[AWTView resizeWithOldSuperviewSize:]':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: 'AWTView' may not respond to '-deliverResize:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: (Messages without a matching method signature
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: will be assumed to return 'id' and accept
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:175: warning: '...' as arguments.)
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetNSViewDisplayID_block_invoke_1':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1308: warning: 'AWTWindow' may not respond to '+getNSWindowDisplayID_AppKitThread:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen_block_invoke_1':
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338: warning: 'NSWindow' may not respond to '-convertRectToScreen:'
/Users/hinmanm/openjdkathome/sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1338: error: incompatible types in assignment
make[5]: *** [/Users/hinmanm/openjdkathome/sources/openjdk7/build/macosx-x86_64/tmp/sun/sun.lwawt/lwawt/obj64/AWTView.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [library_parallel_compile] Error 2
make[3]: *** [all] Error 1
make[2]: *** [all] Error 1
make[1]: *** [jdk-build] Error 2
make: *** [build_product_image] Error 2
can't find java into JDK /Users/hinmanm/openjdkathome/sources/openjdk7/build/macosx-x86_64/j2sdk-image, build failed
XBUILD=true ./obuildfactory/openjdk7/macosx/standalone-job.sh 2486.22s user 342.61s system 182% cpu 25:51.14 total


Reply to this email directly or view it on GitHubhttps://github.com//issues/3#issuecomment-12150747.

@hgomez hgomez closed this Jan 11, 2013
@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Aug 20, 2013

I reattempted the same steps in order to build OpenJDK 7 on Mac OS X 10.6.8,
and I've received build errors, too (one of the errors being the same as one mentioned above), while building the lightweight AWT (liblwawt.dylib) library:

Building lib:sources/openjdk7/build/macosx-x86_64/lib/lwawt/liblwawt.dylib
Begin parallel compiles: sources/openjdk7/jdk/make/sun/lwawt

sources/openjdk7/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m: In function '__Java_sun_java2d_opengl_CGLLayer_nativeSetScale_block_invoke_1':
sources/openjdk7/jdk/src/macosx/native/sun/java2d/opengl/CGLLayer.m:224: error: request for member 'contentsScale' in something not a structure or union
make[5]: *** [sources/openjdk7/build/macosx-x86_64/tmp/sun/sun.lwawt/lwawt/obj64/CGLLayer.o] Error 1

sources/openjdk7/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m: In function '__Java_sun_awt_CGraphicsDevice_nativeGetScaleFactor_block_invoke_1':
sources/openjdk7/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m:298: warning: comparison between pointer and integer
sources/openjdk7/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m:300: warning: 'NSScreen' may not respond to '-backingScaleFactor'
sources/openjdk7/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m:300: warning: (Messages without a matching method signature
sources/openjdk7/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m:300: warning: will be assumed to return 'id' and accept
sources/openjdk7/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m:300: warning: '...' as arguments.)
sources/openjdk7/jdk/src/macosx/native/sun/awt/CGraphicsDevice.m:300: error: incompatible types in assignment
make[5]: *** [sources/openjdk7/build/macosx-x86_64/tmp/sun/sun.lwawt/lwawt/obj64/CGraphicsDevice.o] Error 1

sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m: In function '__Java_sun_lwawt_macosx_CPlatformView_nativeGetLocationOnScreen_block_invoke_1':
sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1337: warning: 'NSWindow' may not respond to '-convertRectToScreen:'
sources/openjdk7/jdk/src/macosx/native/sun/awt/AWTView.m:1337: error: incompatible types in assignment
make[5]: *** [sources/openjdk7/build/macosx-x86_64/tmp/sun/sun.lwawt/lwawt/obj64/AWTView.o] Error 1

Let's analyse each of the above errors.

  1. Before 10.7, CALayer class (a superclass of CGLLayer) is missing contentsScale property — see the class reference. The native AWT method affected is sun.java2d.opengl.CGLLayer#nativeSetScale().
  2. Before 10.7, NSScreen class is missing backingScaleFactor property — see the class reference. The native AWT method affected is sun.awt.CGraphicsDevice#nativeGetScaleFactor().
  3. Before 10.7, NSWindow class is missing convertRectToScreen() method — see the class reference. The native AWT method affected is sun.lwawt.macosx.CPlatformView#nativeGetLocationOnScreen().

This also explains why binary builds of JDK 1.7, despite numerous how-to's (1, 2) are available, shouldn't be installed onto Mac OS X 10.6 using either Pacifist or PackageMaker — whenever any of the above AWT methods are called, the JVM will crash, as the native implementation wouldn't be available.

Unless JDK is intended for pure server-side development (i. e. no AWT), the only viable option for those unwilling to upgrade to Mac OS X 10.7+ is to build OpenJDK with X11 instead of Apple's apple.awt.CToolkit.

@hgomez
Copy link
Owner

@hgomez hgomez commented Aug 20, 2013

Great analysis.

May I suggest you to contact openjdk mailing lists, at least http://openjdk.java.net/projects/macosx-port/
These should be adressed by OpenJDK teams

@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Aug 20, 2013

Thanks.

Ok I can, but what should I tell those guys?

Snow Leopard is no longer supported as a target for JDK 1.7,
and the project page explicitly states this...

P. S. The only aim of my original post was to explain why the build fails, as a lot people (myself included) are still following Google's search results and reaching this page in a hope to get JDK working. I didn't intend to bug anyone with issue reports (as there're no issues).

@hgomez
Copy link
Owner

@hgomez hgomez commented Aug 20, 2013

Well, you could try to propose patch to support 10.6 (at least build support)

@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Aug 20, 2013

Okay.

Maybe I'll have the patch some day =)

@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Aug 21, 2013

Technically, it is possible to wrap each such implementation with the following code:

#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1070
    /*
     * Original 10.7+ Implementation goes here
     */
#else
    const jclass throwable = (*env)->FindClass(env, "java/lang/UnsupportedOperationException");
    if (throwable != NULL) {
        char message[256];
        sprintf(message, "Not implemented in Mac OS X %d", __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__);
        (*env)->ThrowNew(env, throwable, message);
    }
#endif // __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__

This could make the code at least compilable on 10.6.8 Snow Leopard.
Additionally, at runtime, we'll receive an UnsupportedOperationException in Java code instead of the JVM crash.

@hgomez
Copy link
Owner

@hgomez hgomez commented Aug 21, 2013

your best chance is to try to convince Oracle guys to include this stuff inside base code.
Crossing fingers

@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Aug 21, 2013

Okay, I got it built, and the JDK can even run some trivial code.

Any AWT code, however, results in the following error message followed by a core dump:

2013-08-21 18:19:46.618 java[390:903] *** NSInvocation: warning: object 0x10cfc16d0 of class 'ThreadUtilities' does not implement methodSignatureForSelector: -- trouble ahead
2013-08-21 18:19:46.622 java[390:903] *** NSInvocation: warning: object 0x10cfc16d0 of class 'ThreadUtilities' does not implement doesNotRecognizeSelector: -- abort

I'm not an Objective C guru, but the issue seems 10.6-specific (see here). So there's more work ahead, particularly, ThreadUtilities.h needs to be fixed.

@hgomez
Copy link
Owner

@hgomez hgomez commented Aug 21, 2013

Good works. Time to open this discussion to world with a Tweet :)

@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Aug 22, 2013

This is still work in progress, but now I'm finally getting a clean UnsupportedOperationException when trying to run AWT stuff:

$ /Library/Java/JavaVirtualMachines/jdk1.7.0.jdk/Contents/Home/bin/java -jar Metalworks.jar
Exception in thread "main" java.lang.ExceptionInInitializerError
    at javax.swing.UIManager.initialize(UIManager.java:1460)
    at javax.swing.UIManager.maybeInitialize(UIManager.java:1422)
    at javax.swing.UIManager.getDefaults(UIManager.java:656)
    at javax.swing.UIManager.put(UIManager.java:985)
    at Metalworks.main(Metalworks.java:59)
Caused by: java.lang.UnsupportedOperationException: Not implemented in Mac OS X 10.6.8
    at sun.awt.CGraphicsDevice.nativeGetScaleFactor(Native Method)
    at sun.awt.CGraphicsDevice.displayChanged(CGraphicsDevice.java:139)
    at sun.java2d.SunGraphicsEnvironment.displayChanged(SunGraphicsEnvironment.java:275)
    at sun.awt.CGraphicsEnvironment.initDevices(CGraphicsEnvironment.java:165)
    at sun.awt.CGraphicsEnvironment.<init>(CGraphicsEnvironment.java:106)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
    at java.lang.Class.newInstance(Class.java:374)
    at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:109)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)
    at javax.swing.RepaintManager.<clinit>(RepaintManager.java:212)
    ... 5 more

No more JVM crashes =)

@hgomez hgomez reopened this Aug 22, 2013
@hgomez
Copy link
Owner

@hgomez hgomez commented Aug 22, 2013

Well done.

Issue reopened to track your work in progress.

If you succeed, provide patch to OpenJDK team.
If they don't include them in main code, we may include them in obuildfactory process so Snow users could build OpenJDK 7 using obuildfactory scripts.

@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Aug 22, 2013

Finally.

As of now, AWT works for me on 10.6 Snow Leopard.
While I'll be trying to get my changes to the native code incorporated to the OpenJDK project,
there're also changes to your build scripts:

  • openjdk7/macosx/build.sh
  • openjdk7/macosx/standalone-job.sh

Could you please review those?

@hgomez
Copy link
Owner

@hgomez hgomez commented Aug 23, 2013

PR merged.

It's trully a tremendous works you did and I guess you're now the OSX OpenJDK champion for tons of SnowLeopard users.

Many thanks and congrats !

@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Aug 31, 2013

Thank you Henri, and apologies for the delayed response — been busy with other projects.

The corresponding discussion at the macosx-port-dev list is here.

@hgomez
Copy link
Owner

@hgomez hgomez commented Sep 2, 2013

Did you get success in mailing list to get your patches applied ?

@unix-junkie
Copy link
Contributor

@unix-junkie unix-junkie commented Sep 2, 2013

No, not yet.

@hgomez
Copy link
Owner

@hgomez hgomez commented Sep 2, 2013

I see Mike comments ;(
Crossing fingers...

@wyatt8740
Copy link

@wyatt8740 wyatt8740 commented Dec 27, 2013

To me it looks like it didn't happen. I built it from this source anyway, and it's great! Thanks for the hard work, I appreciate it!

@hgomez
Copy link
Owner

@hgomez hgomez commented Jan 21, 2014

Cheers, I'm closing issue

@hgomez hgomez closed this Jan 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants