Unable to get Applescript Engine on some computers

2014-02-27 Thread Paul Taylor

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



Re: Unable to get Applescript Engine on some computers

2014-02-27 Thread Alan Bateman

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


Re: Unable to get Applescript Engine on some computers

2014-02-27 Thread Michael Hall
On Feb 27, 2014, at 4:52 AM, Paul Taylor paul_t...@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…

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

2014-02-27 Thread Andrew Thompson
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 mik3h...@gmail.com wrote:
 
 On Feb 27, 2014, at 4:52 AM, Paul Taylor paul_t...@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…
 
 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

2014-02-27 Thread Andrew Thompson


 On Feb 27, 2014, at 6:10 AM, Alan Bateman alan.bate...@oracle.com 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

2014-02-27 Thread Paul Taylor

On 27/02/2014 11:50, Andrew Thompson wrote:



On Feb 27, 2014, at 6:10 AM, Alan Bateman alan.bate...@oracle.com 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

2014-02-27 Thread Paul Taylor

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 alan.bate...@oracle.com 
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

2014-02-27 Thread Alan Bateman

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

2014-02-27 Thread Paul Taylor

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

2014-02-27 Thread Andrew Thompson
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 paul_t...@fastmail.fm 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 alan.bate...@oracle.com 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

2014-02-27 Thread Paul Taylor

On 27/02/2014 11:07, Michael Hall wrote:

On Feb 27, 2014, at 4:52 AM, Paul Taylor paul_t...@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…

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

2014-02-27 Thread Michael Hall
On Feb 27, 2014, at 8:30 AM, Paul Taylor paul_t...@fastmail.fm 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






FileAttributeView for tags and colors?

2014-02-27 Thread Hendrik Schreiber
Hey there,

I was wondering, wouldn't the tags/colors API in OS X 10.9 be a really nice 
candidate for a java.nio.file.attribute.FileAttributeView?
Is an appropriate implementation planned? I wasn't able to find an RFE on 
https://bugs.openjdk.java.net

Cheers,

-hendrik

Re: FileAttributeView for tags and colors?

2014-02-27 Thread Michael Hall
On Feb 27, 2014, at 3:51 PM, Hendrik Schreiber h...@tagtraum.com wrote:

 Hey there,
 
 I was wondering, wouldn't the tags/colors API in OS X 10.9 be a really nice 
 candidate for a java.nio.file.attribute.FileAttributeView?
 Is an appropriate implementation planned? I wasn't able to find an RFE on 
 https://bugs.openjdk.java.net

Again fwiw,
my trz package has support for a lot of different OS X file attributes, 
including old 'classic', file colors. I sort of liked the idea of color being a 
file attribute myself. Not your usual one.
I am not 10.9 yet but when I get there if this API concerns this same sort of 
thing I would be happy to include it in trz anyhow.
It is quite possible to add something like this along with a 'pass through' 
type file system. So you could possibly come up with it yourself without 
excessive effort.

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: FileAttributeView for tags and colors?

2014-02-27 Thread Hendrik Schreiber
On Feb 27, 2014, at 23:35, Michael Hall mik3h...@gmail.com wrote:

 On Feb 27, 2014, at 3:51 PM, Hendrik Schreiber h...@tagtraum.com wrote:
 Again fwiw,
 my trz package has support for a lot of different OS X file attributes, 
 including old 'classic', file colors. I sort of liked the idea of color being 
 a file attribute myself. Not your usual one.
 I am not 10.9 yet but when I get there if this API concerns this same sort of 
 thing I would be happy to include it in trz anyhow.
 It is quite possible to add something like this along with a 'pass through' 
 type file system. So you could possibly come up with it yourself without 
 excessive effort.

Thanks for the pointer, Michael. For my own needs, I will probably just roll my 
own (since the API is trivial), but for the future I wouldn't mind seeing APIs 
like this exposed through the regular JDK. And if nobody asks for it, it never 
gets done...so I ask. ;-)

Cheers,

-hendrik