wocommunity / wolips

wolips
53 stars 53 forks source link

WO Launch configurations generate wrong classpath for maven projects at runtime #153

Open hugithordarson opened 3 years ago

hugithordarson commented 3 years ago

The classpath generated when launching a Maven application in Eclipse using a WO Launch configuration vs. when starting it as a regular java application is different. Most notably, when started as a WO application it seems:

This only applies when running from within Eclipse, i.e. the classpath.txt generated by an actual maven build looks like one would expect.

hugithordarson commented 2 years ago

Replacing the WOLips classpath provider (WORuntimeClasspathProvider) with org.eclipse.m2e.launchconfig.classpathProvider results in a correct (or at least standard/expected) classpath being generated, but results in _NSUtilities.classWithName() having issues with locating some classes from the main bundle, such as Mainand DirectAction. I'm guessing due to some issue with classpath ordering.

Going to pursue this direction and see if it that can be fixed from the WO side.

hugithordarson commented 2 years ago

For the past few days I've been using the regular Java launcher in Eclipse to launch my apps, rather than the WOLips launcher. This means a correct classpath is generated by Eclipse/m2e. Everything seems to work perfectly fine, although two modifications have to be made to the Java launch configuration when it's created.

  1. Add the VM argument -DNSProjectBundleEnabled=true
  2. Set the working dir to ${working_dir_loc_WOLips:[YourProjectName]}

Since this works for me, I'm not going to put any more work into trying to fix the WOLips launcher for now (but I'll not go so far as to close the issue since this is still broken in the WOLips launcher).