http://webreference.com/javascript/reference/core_ref/packages.html
That link is about the Rhino JavaScript engine, which is written in Java, and not to my knowledge used in any browser. I assume you're talking about JavaScript in the context of a browser. In that case you're looking for a technology called LiveConnect, which enables two-way communication between Java
applets and JavaScript within a web page. Unfortunately, LiveConnect is not supported by all browsers.
Here is a test page you can use to check your browser.