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: Are there special requirements for invoking Java in a script controlled by launchd?



Greg Guerin wrote:

I went back to my earlier experiments, split it into two jars, modified it
to make sure there was a cross-jar reference, and it worked fine.

I did it yesterday exactly as you show here, and it didn't work, multiple times, with everything double-checked. I tried from the Terminal the same classpath combo use din the plist (using absolute paths in the plist and the command line) and it worked in Terminal, leading me to wonder if I had the plist schema wrong. But today I tried the two-path plist, and it worked. So I must have had something else wrong yesterday. I'll put this one down as a hardware problem... a loose nut on the keyboard. Probably the failure to unload was causing the problem, as you mentioned below.

The path you used is a symlink, just like /usr/bin/java is. So if you can withstand various Java versions, including a future 1.6, the path you have now should work. So should /usr/bin/java.

However, if you need a specific version, e.g. 1.5, then you should use the
".../Versions/1.5/Commands/java" pathname.  BTW, "1.5" is itself a symlink.

  -- GG


This particular app works with 1.4+, but I wanted to know how to make it work with whatever version constraints I may have. So you told me what I needed to know. Seems I could either code the installer and agent plist to the symlink for the "installed" JVM, and have the installer tell the user what the minimum version required is, or script the installer to look for the proper JVM version and abort the install (or duly warn) otherwise. I saw your earlier post about putting a confirmer class in the code. Nice idea, but more trouble than I want to go to with this app. I use Class.forName() to manually load a couple classes for optional features if Java 5+ is being used. I didn't want to preclude 1.4 use over a couple optional features, but wanted to include them for Java 5+ users.

Thanks to you and Mike for your help on this.

-Mark

_______________________________________________
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
References: 
 >Re: Are there special requirements for invoking Java in a script controlled by launchd? (From: Greg Guerin <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.