I have a small problem interacting with code from jython.

The java 'package foo.bar;' system kind of gets in the way of things... a lot. A simple example;

package com.foo;   

public class HelloWorld {
    public void hello() {
        System.out.println("Hello World!");
    public void hello(String name) {
        System.out.printf("Hello %s!", name);
    public static void main(String[] args) {
        System.out.println("In main");

I find that 'package com.foo' prevents two things from happening:
   1) it prevents main from running when java is compiled and run;
   2) it prevents HelloWorld from being imported by the jython interpreter;

If I remove 'package com.foo;' none of the above problems occur.

Moreover if I have the directory, or the .class file, or the .java file, or the .jar file *direcly* on my CLASSPATH, it makes no difference to jython.

So I guess I don't understand java's package system. I just get

        ImportError: cannot import name HelloWorld

I have tried renaming the .jar file 'HelloWorld.jar' and 'com.foo.jar' and it makes no difference.

Could I trouble you with 2 questions:

      How do I access java code with the 'package ...' syntax, using jython?

      Do I need to be above com.foo or in com.foo?

A simple example would be fantastic - I have looked but find no such basic advice.

Thanks in advance - i am coming from python where all of this is done automatically