Ubuntu

Rhino support (com.sun.script.javascript.*) removed between OpenJDK 6 and 7

Reported by Yuval S on 2012-04-15
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenJDK
Fix Released
Unknown
openjdk-7 (Ubuntu)
Undecided
Unassigned

Bug Description

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

Yuval S (yuval-s) on 2012-04-15
description: updated
Damien Raude-Morvan (drazzib) wrote :

Fixed in 7~u3-2.1.1~pre1-1ubuntu2

Changed in openjdk-7 (Ubuntu):
status: New → Fix Released
Changed in openjdk:
status: Unknown → New
Changed in openjdk:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.