Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: java 1.6 config on install
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java 1.6 config on install



Adam Fisk wrote:

Hi Everyone-  I'm using a postflight bash script in my installer to
detect Java 1.6 support and to dynamically swap in 1.6+ in my
Info.plist if it's available.  I'd imagine this is something many
people, want, so I'm posting the code in case it's useful to anyone
and to get feedback as to whether I've missed anything.  It's
basically checking that 1.6 exists on the machine and that the machine
is 64 bit (has an Intel processor, but the Intel processor is not
Intel Core Duo and not Solo).


What does this give you that "1.5+" doesn't?

If your Java source will run on 1.5 or 1.6, it still must be compiled for 1.5. So specifying "1.5+" gets you what you need. If there's a 1.6 available, then the system will use it, otherwise it will use 1.5. That's what "1.5+" means.

Conversely, if your code requires Java 6, which is what "1.6+" implies, then specifying "1.5+" is clearly a mistake.

I could be missing something, but this dynamic swap-in of 1.6+ seems like an unnecessary complication.


test -d /System/Library/Frameworks/JavaVM.framework/Versions/1.6 &&
system_profiler SPHardwareDataType | grep Processor\ Name | grep Intel
| grep -v "Intel Core Duo" | grep -v Solo && switchToJava6


It would be a lot simpler if you used the 'sysctl' command rather than system_profiler and grepping for specific patterns. The sysctl names hw.cuptype, hw.cpusubtype, and hw.cpu64bit_capable will be of most interest.

Also see the 'arch' command, especially its ARCHPREFERENCE env-var.

  -- GG





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.