1

I have a working Rhino project, with several JavaScript and Java files working together. Now, I would like to compile the JS to Java .class files. It should create the equivalent Java class. One of my JS files would look like this.

load ('org/me/SomeJSClass.js');
importClass(Packages.org.me.SomeJavaClass);

function Fruit(n, arr) {
    this.name = n;
    this.foo = function(bar) {...};
}

According to the answer here, I can do that if I first have a Java interface/abstract class to extend from, but I don't want to do that for every JS file. Is there a solution without extending, Java classes. If not, can the Java class be generated for me?

Community
  • 1
  • 1
jmullercuber
  • 178
  • 1
  • 9

0 Answers0