Re: Unable to get Applescript Engine on some computers
On Feb 27, 2014, at 8:30 AM, Paul Taylor wrote: >> > FYI I tried this, and it worked ! > Brilliant thanks solved a big problem for me Glad to hear it worked for you. I hope it is for anyone trying out my application. Michael Hall trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz HalfPipe Java 6/7 shell app http://www195.pair.com/mik3hall/index.html#halfpipe AppConverter convert Apple jvm to openjdk apps http://www195.pair.com/mik3hall/index.html#appconverter
Re: Unable to get Applescript Engine on some computers
On 27/02/2014 11:07, Michael Hall wrote: On Feb 27, 2014, at 4:52 AM, Paul Taylor 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… 1) Provide the code in the jar and dylib yourself. This is what I did and what I made available on github at… https://github.com/mik3hall/AppleScriptEngine 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 Paul
Re: Unable to get Applescript Engine on some computers
From what I understand from working with the service loader framework in general if the relevant config file is present on the classpath, either loose as a file or in any jar it will be used. The file would be META-INF/services/something. Given that jar is in the extensions directory I think it will be loaded regardless of name. Try moving it to another folder temporarily? > On Feb 27, 2014, at 8:11 AM, Paul Taylor wrote: > >> On 27/02/2014 12:16, Paul Taylor wrote: >>> On 27/02/2014 11:50, Andrew Thompson wrote: >>> On Feb 27, 2014, at 6:10 AM, Alan Bateman wrote: The JDK does include the AppleScriptEngine but is missing the service configuration file that is needed to locate it. There is a bug open for this but it does raise the question as to whether the JDK really needs to bundle this scripting engine or not. >>> I think the issue here is right now a lot of customers still have at least >>> some fragments of Apple's Java 6 installed which makes this work. >>> >>> As more machines come to exist which have only ever had Java 7 or greater >>> on them we'd see this issue more often, unless it is fixed. >>> >>> Right now I think this masking makes it impossible to estimate how widely >>> used this engine is. >> This is a terrible slip up, I assume you do java builds on clean machine so >> I assume you don't have a single until test for checking talking to >> Applescript engine. >> >> I dread to think how many potential customers have tried my application and >> given up when it fails to update iTunes ( a key part on of the appilication >> for many OSX users), and Ive been unaware >> >> Paul > I wanted to replicate the issue before fixing so I renamed > /System/Library/Java/Extensions/AppleScriptEngine.jar and > libAppleScriptEngine.jniLib but it stills works. > I searched the whole hard disk and couldn't find any other copies > What do I need to do to make it fail ? > > Paul
Re: Unable to get Applescript Engine on some computers
On 27/02/2014 13:17, Alan Bateman wrote: On 27/02/2014 13:11, Paul Taylor wrote: : I wanted to replicate the issue before fixing so I renamed /System/Library/Java/Extensions/AppleScriptEngine.jar and libAppleScriptEngine.jniLib but it stills works. I searched the whole hard disk and couldn't find any other copies What do I need to do to make it fail ? Is the renamed JAR file still in /System/Library/Java/Extensions? If so then move it where because that directory is used by the extensions mechanism (all JAR files in there are searched). -Alan. Ah yes, I renamed to .old file thinking that would do it, but moving it out completely does replicate the issue thanks Paul
Re: Unable to get Applescript Engine on some computers
On 27/02/2014 13:11, Paul Taylor wrote: : I wanted to replicate the issue before fixing so I renamed /System/Library/Java/Extensions/AppleScriptEngine.jar and libAppleScriptEngine.jniLib but it stills works. I searched the whole hard disk and couldn't find any other copies What do I need to do to make it fail ? Is the renamed JAR file still in /System/Library/Java/Extensions? If so then move it where because that directory is used by the extensions mechanism (all JAR files in there are searched). -Alan.
Re: Unable to get Applescript Engine on some computers
On 27/02/2014 12:16, Paul Taylor wrote: On 27/02/2014 11:50, Andrew Thompson wrote: On Feb 27, 2014, at 6:10 AM, Alan Bateman wrote: The JDK does include the AppleScriptEngine but is missing the service configuration file that is needed to locate it. There is a bug open for this but it does raise the question as to whether the JDK really needs to bundle this scripting engine or not. I think the issue here is right now a lot of customers still have at least some fragments of Apple's Java 6 installed which makes this work. As more machines come to exist which have only ever had Java 7 or greater on them we'd see this issue more often, unless it is fixed. Right now I think this masking makes it impossible to estimate how widely used this engine is. This is a terrible slip up, I assume you do java builds on clean machine so I assume you don't have a single until test for checking talking to Applescript engine. I dread to think how many potential customers have tried my application and given up when it fails to update iTunes ( a key part on of the appilication for many OSX users), and Ive been unaware Paul I wanted to replicate the issue before fixing so I renamed /System/Library/Java/Extensions/AppleScriptEngine.jar and libAppleScriptEngine.jniLib but it stills works. I searched the whole hard disk and couldn't find any other copies What do I need to do to make it fail ? Paul
Re: Unable to get Applescript Engine on some computers
On 27/02/2014 11:50, Andrew Thompson wrote: On Feb 27, 2014, at 6:10 AM, Alan Bateman wrote: The JDK does include the AppleScriptEngine but is missing the service configuration file that is needed to locate it. There is a bug open for this but it does raise the question as to whether the JDK really needs to bundle this scripting engine or not. I think the issue here is right now a lot of customers still have at least some fragments of Apple's Java 6 installed which makes this work. As more machines come to exist which have only ever had Java 7 or greater on them we'd see this issue more often, unless it is fixed. Right now I think this masking makes it impossible to estimate how widely used this engine is. This is a terrible slip up, I assume you do java builds on clean machine so I assume you don't have a single until test for checking talking to Applescript engine. I dread to think how many potential customers have tried my application and given up when it fails to update iTunes ( a key part on of the appilication for many OSX users), and Ive been unaware Paul
Re: Unable to get Applescript Engine on some computers
> On Feb 27, 2014, at 6:10 AM, Alan Bateman wrote: > >> > > The JDK does include the AppleScriptEngine but is missing the service > configuration file that is needed to locate it. There is a bug open for this > but it does raise the question as to whether the JDK really needs to bundle > this scripting engine or not. I think the issue here is right now a lot of customers still have at least some fragments of Apple's Java 6 installed which makes this work. As more machines come to exist which have only ever had Java 7 or greater on them we'd see this issue more often, unless it is fixed. Right now I think this masking makes it impossible to estimate how widely used this engine is.
Re: Unable to get Applescript Engine on some computers
It's probably sufficient to put the necessary configuration anywhere on the classpath? I doubt one actually has to hack resources.jar? > On Feb 27, 2014, at 6:07 AM, Michael Hall wrote: > >> On Feb 27, 2014, at 4:52 AM, Paul Taylor 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… > > 1) > Provide the code in the jar and dylib yourself. This is what I did and what I > made available on github at… > https://github.com/mik3hall/AppleScriptEngine > 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. > > 2). > Fix the openjdk configuration error yourself. This means adding the > AppleScriptEngine entry to the config file in resources.jar. I believe the > bug report I gave earlier details how to do that. > > 3). > Wait for openjdk to correct the configuration file in resources.jar > > My understanding on that one anyhow. > > Michael Hall > > trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz > > HalfPipe Java 6/7 shell app > http://www195.pair.com/mik3hall/index.html#halfpipe > > AppConverter convert Apple jvm to openjdk apps > http://www195.pair.com/mik3hall/index.html#appconverter > > >
Re: Unable to get Applescript Engine on some computers
On 27/02/2014 11:07, Michael Hall wrote: On Feb 27, 2014, at 4:52 AM, Paul Taylor 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… 1) Provide the code in the jar and dylib yourself. This is what I did and what I made available on github at… https://github.com/mik3hall/AppleScriptEngine 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. 2). Fix the openjdk configuration error yourself. This means adding the AppleScriptEngine entry to the config file in resources.jar. I believe the bug report I gave earlier details how to do that. 3). Wait for openjdk to correct the configuration file in resources.jar My understanding on that one anyhow. Michael Hall trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz HalfPipe Java 6/7 shell app http://www195.pair.com/mik3hall/index.html#halfpipe AppConverter convert Apple jvm to openjdk apps http://www195.pair.com/mik3hall/index.html#appconverter Oh, sorry didnt notice those post, okay I'll try solution 1 Paul
Re: Unable to get Applescript Engine on some computers
On Feb 27, 2014, at 4:52 AM, Paul Taylor 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… 1) Provide the code in the jar and dylib yourself. This is what I did and what I made available on github at… https://github.com/mik3hall/AppleScriptEngine 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. 2). Fix the openjdk configuration error yourself. This means adding the AppleScriptEngine entry to the config file in resources.jar. I believe the bug report I gave earlier details how to do that. 3). Wait for openjdk to correct the configuration file in resources.jar My understanding on that one anyhow. Michael Hall trz nio.2 for OS X http://www195.pair.com/mik3hall/index.html#trz HalfPipe Java 6/7 shell app http://www195.pair.com/mik3hall/index.html#halfpipe AppConverter convert Apple jvm to openjdk apps http://www195.pair.com/mik3hall/index.html#appconverter
Re: Unable to get Applescript Engine on some computers
On 27/02/2014 10:52, Paul Taylor 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 Any ideas ? Michael Hall brought this up a few days ago too. I assume you have /System/Library/Java/Extensions/AppleScriptEngine.jar but some of your customers don't. The JDK does include the AppleScriptEngine but is missing the service configuration file that is needed to locate it. There is a bug open for this but it does raise the question as to whether the JDK really needs to bundle this scripting engine or not. -Alan
Unable to get Applescript Engine on some computers
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 Any ideas ? Paul