Context:
My workspace is set up as follows:
~/workspace/gsoc-phase1-fork2/
net.sf.j2s.ajax
net.sf.j2s.core
net.sf.j2s.java.core
net.sf.j2s.lib
net.sf.j2s.ui
org.eclipse.draw2d
org.eclipse.draw2d.examples/
src/
org.eclipse.draw2d.examples/
AbstractExample.java
ExampleImages.java
ExampleUtil.java
HelloWorld.java
RemoteSystemsTempFiles
test
testj2s
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.
Expected Behaviour:
When running org.eclipse.draw2d.examples.HellowWorld.html, the classes in org.eclipse.draw2d should be loaded correctly.
Actual Behaviour:
When running org.eclipse.draw2d.examples.HellowWorld.html, the classes in org.eclipse.draw2d cannot be found.
Additional Information:
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.
Workaround:
I've worked around this by creating a symlink in the root of my workspace called "bin" which links to org.eclipse.draw2d/bin
Directory contents from my Eclipse plugin dir
Eclipse folder
Directory contents from workspace