Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Now Available: J2SE 5.0 Release 3 Developer Preview 3



Shawn Erickson wrote:

On Oct 12, 2005, at 7:18 PM, Vic Cekvenich wrote:

So back to the  question: How do I write an installler to change
the default preference to 5.0 if its there for my end users, or
what files does the apple preference application change to make 5.0
prefered for applets and webstart please, that is what my question
is so that 5.0 is default after it's installed so that I can detect
it from my website?

You don't and shouldn't. Why not attempt to detect what they have installed and then change what you request instead of changing a default that is intended to be under the users control.

If you absolutely *must* do this (to get double-clicked JARs to open in 1.5, for example) here are my thoughts: - don't try and install 1.5 yourself, at most send the user's web browser to Apple's download page - consider opening the Java Preferences application, instructing the user to make the necessary change (use Runtime.exec with a String array of command line arguments containing "open" and "/Applications/Utilities/Java/J2SE 5.0/Java Preferences.app", note the usual caveats about Runtime.exec, argument parsing, and using multiple threads to drain the output streams so it cannot deadlock) - if 1.5 is already present, but not being used, post a dialog asking the user for permission to tweak the preferred JVM, and if they say 'no', either quit cleanly or carry on with degraded features (if you can do so cleanly) - if and only if the user OKs it (and the file already exists), go in and munge ~/Library/Caches/java/deployment.properties. It looks like you need to change the index numbers in the deployment.javaws.jre.#.* (where # is the index number, 0 is the highest JRE), but I haven't tried it. Keep a backup copy of the properties file, in case it hits the fan. Once munged, quit and restart your application.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

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 © 2007 Apple Inc. All rights reserved.