In underlying code you are correct. But they both work in a C/C++ style. JavaScript has become a 'Write Once, Run Anywhere' foundation because of the web browser. Don't forget projects like NWJS (Node Webkit), Electron, Cordova/PhoneGap, Google Chrome Apps, NodeJS, and ClearScript(.NET).
All of these JavaScript implementations use the V8 JVM and can make desktop and command line application. Depending on security settings they can give partial to full system access to the underlying OS just like Java. If this ruling is upheld I would look for Oracle to float a trial balloon on newer JavaScript implementations and for stealing their Java's API's.