This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 209491 - Unable to create javax script engine for javascript
Summary: Unable to create javax script engine for javascript
Status: RESOLVED WONTFIX
Alias: None
Product: javafx
Classification: Unclassified
Component: Deployment (show other bugs)
Version: 7.1.1
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Assignee: Petr Somol
URL:
Keywords:
Depends on:
Blocks: 212394
  Show dependency tree
 
Reported: 2012-03-12 21:28 UTC by argodar
Modified: 2012-05-11 15:29 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description argodar 2012-03-12 21:28:27 UTC
- Operating system: Ubuntu 11.10 64 bits
- Netbeans 7.1.1
- Java FX 2.1 b16 32 bits
- JDK 7u2

I created a new platform using JDK 7u2 32bits and Java FX 2.1 b16 32 bits. When building my application (a new JavaFX application, created in Netbeans, with only the auto-generated code) I'm getting the error: 

JavaFXApplication1/nbproject/jfx-impl.xml:976: The following error occurred while executing this line:
JavaFXApplication1/nbproject/jfx-impl.xml:399: Unable to create javax script engine for javascript
Comment 1 Petr Somol 2012-03-13 10:42:31 UTC
The JDK you use is Oracle JDK or OpenJDK ? We have discovered a problem with OpenJDK 7 where JavaScript engine has been removed. JavaScript engine is needed to build a FX Project. Note that OpenJDK 6 and all Oracle JDKs do contain JavaScript engine.
Comment 2 argodar 2012-03-13 11:47:23 UTC
I have installed OpenJDK 7 64 bits on my machine. However , in Netbeans I created a new platform using Oracle JDK7 32 bits and Java FX 2.1 b16 32 bits and assigned it to the project I'm trying to build. So I assume Oracle JDK 7 is used for the purpose of building and that the javascript engine is present.

I haven't tried with the Oracle JDK6. I could give this a try.
Comment 3 Petr Somol 2012-04-02 08:10:18 UTC
I checked more thoroughly what is the problem here and realized that NetBeans by design execute Ant by internal execution. See

http://netbeans.org/bugzilla/show_bug.cgi?id=204303#c3

The JDKs/SDKs defined in non-default platform would be correctly used if the Ant script did not fail to run. But the fact that Ant runs internally means that JavaScript support is expected to be present in the default platform on which NetBeans itself is running. This is unfortunately not the case with OpenJDK 7.

The workaround is to run NetBeans on any of the supported JDKs, which contain JavaScript support. The option to run Ant itself in the other-than-default VM is unsuitable for reasons explained by the comment linked above. Since there is no good way of compensating for the OpenJDK 7 missing scripting support, I'm closing as wantfix.
Comment 4 Cheloveche 2012-04-06 16:50:04 UTC
There is no need to support Linux in JavaFX without proper OpenJDK support in the IDE. Oracle JDK is not packaged by distributions (which means it is really NOT SUPPORTED). Users will just quickly try out new brand SDK, discover it is not working and move to concurrent technology.
Comment 6 Stepan Zebra 2012-04-25 11:33:52 UTC
(In reply to comment #4)
> There is no need to support Linux in JavaFX without proper OpenJDK support in
> the IDE. Oracle JDK is not packaged by distributions (which means it is really
> NOT SUPPORTED). Users will just quickly try out new brand SDK, discover it is
> not working and move to concurrent technology.

Missing JavaScript engine in OpenJDK 7 isn't a bug in NetBeans. If you have a problem with running NetBeans on OpenJDK that is caused by NetBeans, create a new issue and describe your problem there.
Comment 7 Cheloveche 2012-05-11 12:51:46 UTC
> Missing JavaScript engine in OpenJDK 7 isn't a bug in NetBeans.

You are right - it is probably bug in JSR 270 (the Java 6 SE spec):

    There will be no requirement that any particular scripting language be supported by the platform; implementors may choose to include support for the scripting language(s) of their choice as they see fit.

Sadly one can not fix JSR as easily as you wish Linux users to. Anyway Groovy is bundled with IDE, whats wrong with doing the same thing for Javascript engine?

PS I promise that it is the last time I am re-opening this bug, please at least explain reasons for closing it as "wontfix" this time instead of just calling official Oracle implementation for Linux buggy.
Comment 8 Petr Somol 2012-05-11 14:57:48 UTC
OpenJDK 7 seems to be the only JDK where scripting engine has been excluded. AFAIK the next versions are likely to have it back. All OracleJDK versions do contain scripting engine and NetBeans is tested against OracleJDK. I am not the decision maker but I doubt including a OpenJDK 7 scripting engine to NetBeans distribution is a viable option. CC-ing Marian on that.

Yet I do not say we do not care at all. I have created another issue to at least partly address the problem of scripting on our (NetBeans) side:
netbeans.org/bugzilla/show_bug.cgi?id=212394

I just can not do more, so I am definitely closing this particular issue.
Comment 9 Stepan Zebra 2012-05-11 15:29:33 UTC
BTW problem was reported from user running Ubuntu, where it's already fixed:
https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/920214