My workspace is set up as follows:
HelloWord.java in org.eclipse.draw2d.examples is the project I am attempting to compile. org.eclipse.draw2d is on the Java2Script build path for org.eclipse.draw2d.examples.
When running org.eclipse.draw2d.examples.HellowWorld.html, the classes in org.eclipse.draw2d should be loaded correctly.
When running org.eclipse.draw2d.examples.HellowWorld.html, the classes in org.eclipse.draw2d cannot be found.
I believe this is caused by the build path not being set up correctly by j2s. Here's a snippet from the onload function generated by j2s in org.eclipse.draw2d.examples.HellowWorld.html:
ClazzLoader.packageClasspath (["org.eclipse.draw2d.parts", "$.widgets", "org.eclipse.draw2d", "org.eclipse.draw2d.text", "$.internal", "$.geometry", "$.graph"], "../bin/");
I believe this is the code that sets up the classpath for org.eclipse.draw2d. It appears as though it registers the classpath to "../bin", where it should be "../org.eclipse.draw2d/bin". It seems likely that this is what is causing the unexpected behaviour.
I've worked around this by creating a symlink in the root of my workspace called "bin" which links to org.eclipse.draw2d/bin