How to import your own non-packaged Java classes in Jython

Posted by thepandaatemyface on Stack Overflow See other posts from Stack Overflow or by thepandaatemyface
Published on 2010-04-21T10:59:48Z Indexed on 2010/04/21 11:03 UTC
Read the original article Hit count: 278

Filed under:
|
|

I know in Jython you can do

import java.util.Random as Random
Random().nextInt()

But if I have a class I wrote myself, how can I import it into Jython without putting the class itself in a package? If I have a testclass Test:

public class Test {
    public void foo() {
        System.out.println("bar");
    }
}

that's not inside a package. Can I even import that into jython by using something along the lines offrom Test import Test?

© Stack Overflow or respective owner

Related posts about jython

Related posts about java