Public bug reported: The packages specifying Rhino support, `com.sun.script.javascript.*`, are missing from OpenJDK 7, though they were included in OpenJDK 6. This causes the `getEngineByName("JavaScript")` call on a `ScriptEngineManager` to return `null` (see my [StackOverflow question for this issue][1]).
Specifically, this code should return `2` but throws a `NullPointerException`: ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); try { System.out.println(engine.eval("1+1")); } catch (ScriptException e) { // TODO Auto-generated catch block e.printStackTrace(); } This might very well be the cause of [openjdk-7 bug #920214][2]. According to [Oracle bug #6876736][3], this is indeed a distro bug. Note that when Rhino was included in OpenJDK 6, it caused package conflicts ([openjdk-6 bug #255149][4], [Debian bug #512970][5]) . Based on question [#192941][6] OS: Ubuntu 11.10 OpenJDK version: 7~b147-2.0-0ubuntu0.11.10.1 [1]: http://stackoverflow.com/questions/10054252/trying-to-use-rhino-getenginebynamejavascript-returns-null-in-openjdk-7 [2]: https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/920214 [3]: http://bugs.sun.com/view_bug.do?bug_id=6876736 [4]: https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/255149 [5]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512970 [6]: https://answers.launchpad.net/ubuntu/+source/openjdk-7/+question/192941 ** Affects: openjdk-7 (Ubuntu) Importance: Undecided Status: New ** Description changed: The packages specifying Rhino support, `com.sun.script.javascript.*`, are missing from OpenJDK 7, though they were included in OpenJDK 6. This causes the `getEngineByName("JavaScript")` call on a `ScriptEngineManager` to return `null` (see my [StackOverflow question for this issue][1]). Specifically, this code should return `2` but throws a `NullPointerException`: - ScriptEngineManager factory = new ScriptEngineManager(); - ScriptEngine engine = factory.getEngineByName("JavaScript"); - try { - System.out.println(engine.eval("1+1")); - } catch (ScriptException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + ScriptEngineManager factory = new ScriptEngineManager(); + ScriptEngine engine = factory.getEngineByName("JavaScript"); + try { + System.out.println(engine.eval("1+1")); + } catch (ScriptException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } - - This might very well be the cause of [openjdk-7 bug #920214][2]. According to [Oracle bug #6876736][3], this is indeed a distro bug. + This might very well be the cause of [openjdk-7 bug #920214][2]. + According to [Oracle bug #6876736][3], this is indeed a distro bug. Note that when Rhino was included in OpenJDK 6, it caused package conflicts ([openjdk-6 bug #255149][4], [Debian bug #512970][5]) . Based on question [#192941][6] OS: Ubuntu 11.10 OpenJDK version: 7~b147-2.0-0ubuntu0.11.10.1 - [1]: http://stackoverflow.com/questions/10054252/trying-to-use-rhino-getenginebynamejavascript-returns-null-in-openjdk-7 - [2]: https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/920214 - [3]: http://bugs.sun.com/view_bug.do?bug_id=6876736 - [4]: https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/255149 - [5]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512970 - [6]: https://answers.launchpad.net/ubuntu/+source/openjdk-7/+question/192941 + [1]: http://stackoverflow.com/questions/10054252/trying-to-use-rhino-getenginebynamejavascript-returns-null-in-openjdk-7 + [2]: https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/920214 + [3]: http://bugs.sun.com/view_bug.do?bug_id=6876736 + [4]: https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/255149 + [5]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512970 + [6]: https://answers.launchpad.net/ubuntu/+source/openjdk-7/+question/192941 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/982501 Title: Rhino support (com.sun.script.javascript.*) removed between OpenJDK 6 and 7 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openjdk-7/+bug/982501/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs