You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@karaf.apache.org by "Guillaume Nodet (JIRA)" <ji...@apache.org> on 2017/06/27 13:02:00 UTC

[jira] [Comment Edited] (KARAF-4603) Nashorn support in Karaf

    [ https://issues.apache.org/jira/browse/KARAF-4603?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16064794#comment-16064794 ] 

Guillaume Nodet edited comment on KARAF-4603 at 6/27/17 1:01 PM:
-----------------------------------------------------------------

I'm not sure to understand why this would be related to packages and boot delegation.
On Java8, I can run the following on a bare karaf:
{code}
karaf@root()> ((($.context bundle 0) loadClass javax.script.ScriptEngineManager) newInstance) getEngineByName "js"
Factory              jdk.nashorn.api.scripting.NashornScriptEngineFactory@35b56646
Context              javax.script.SimpleScriptContext@4130f92c

{code}


was (Author: gnt):
I'm not sure to understand why this would be related to packages and boot delegation.
On Java8, I can run the following on a bare karaf:
{code}
karaf@root()> ((($.context bundle 0) loadClass javax.script.ScriptEngineManager) newInstance) getEngineByName "js"                                                          15:00:24
Factory              jdk.nashorn.api.scripting.NashornScriptEngineFactory@35b56646
Context              javax.script.SimpleScriptContext@4130f92c

{code}

> Nashorn support in Karaf
> ------------------------
>
>                 Key: KARAF-4603
>                 URL: https://issues.apache.org/jira/browse/KARAF-4603
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-osgi
>    Affects Versions: 3.0.7
>         Environment: Ubuntu 16.04
> OpenJDK 8 64-bit
>            Reporter: Roman Sakno
>
> I can't use JavaScript scripting in Karaf on Java 8 because ScriptEngineFactory implementation (provided by Nashorn) is located in system package {{jdk.nashorn.api.scripting}}. In Java 7, Rhino implementation is located in package {{com.sun.script.javascript}}. By default, Karaf offers some system packages (including {{com.sun}}) in configuration property {{org.osgi.framework.bootdelegation}} which is defined in file {{etc/config.properties}}. That's why Rhino available from Karaf. It will be great if you add {{jdk.nashorn}} to boot delegation by default.    



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)