Unable to get Applescript Engine on some computers
paul_t100 at fastmail.fm
Thu Feb 27 06:30:23 PST 2014
On 27/02/2014 11:07, Michael Hall wrote:
> On Feb 27, 2014, at 4:52 AM, Paul Taylor <paul_t100 at fastmail.fm> wrote:
>> In my code I have:
>> ScriptEngineManager mgr = new ScriptEngineManager();
>> ScriptEngine engine = mgr.getEngineByName("AppleScript");
>> this works fine for me, but for some customers in returns null for engine.
>> We are using Java 1.8.0 25.0-b69 64bit (build 129)
>> Customer was on Mac OS X 10.9.2 x86_64, I've upgraded to same version still don't get the problem.
>> Applescript does exist because earlier in my code I run some applescript using osascript and Runtime class and that works fine
> l don't know that it was precisely determined what caused this. Possibly some change in an OS upgrade where Apple removed something from their java distribution?
> Although we didn't know it, we were relying on the Apple code being in place.
> Your three options would be…
> Provide the code in the jar and dylib yourself. This is what I did and what I made available on github at…
> All you really need are the jar and dylib.
> Put the dylib in the application's MacOSX folder. appbundler adds that to LD_LIBRARY_PATH.
> Put the jar in the application's Java folder, this should get it into class path.
> Done and should work on any configuration.
FYI I tried this, and it worked !
Brilliant thanks solved a big problem for me
More information about the macosx-port-dev