RFR 8143404: Remove apple script engine code in jdk repository

Alan Bateman Alan.Bateman at oracle.com
Mon Dec 14 08:55:18 UTC 2015


On 07/12/2015 19:38, Mike Dever Google wrote:
> Is there a work around?
> That really limits, actually kills a lot of functionality.

The JDK 7 and JDK 8 builds don't declare AppleScript in the services 
configuration file (META-INF/services/javax.script.ScriptEngineFactory). 
This means that if you've never had Apple's JDK bits on your system then 
jrunscript -q will not locate the AppleScript implementation.

On the other hand, if your system has 
/System/Library/Java/Extensions/AppleScriptEngine.jar then jrunscript -q 
will locate it and print out something like "Language AppleScript 2.4 
implementation ...". The fact that it actually loads the version in 
rt.jar is a bit odd of course.

In any case, JDK 9 drops the legacy extension mechanism (JEP 220 has the 
more details, the deprecation of this mechanism was also announced in 
the maintenance release of JSR 337). This means that service lookup will 
not look in the system directories like /System/Library/Java/Extensions 
and so the services configuration file in AppleScriptEngine.jar will not 
be found. So irrespective of Sundar's proposal to just remove the code, 
you will find that jrunscript in JDK 9 build has not located the 
AppleScript implementation for a long time (more than a year).

As regards workaround then all I can suggest is to add 
/System/Library/Java/Extensions/AppleScriptEngine.jar to your class path 
and then it will use the AppleScript implementation from Apple's JDK 6. 
As regards maintaining this code then there probably is an opportunity 
for someone to run it as as a standalone project/library.

-Alan.



More information about the core-libs-dev mailing list