Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I was close, it wasn't CLASSPATH per se, but rather (apparently) Eclipse project settings. </p> <p>After a week or more of chasing this off and on, I edited the .project file to include certain buildCommand tags that my project didn't have. Adding the following buildCommands to the section allowed my code to launch Java classes from JavaScript after restarting Eclipse.</p> <pre><code>&lt;buildSpec&gt; &lt;buildCommand&gt; &lt;name&gt;org.eclipse.jdt.core.javabuilder&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;buildCommand&gt; &lt;name&gt;org.eclipse.wst.jsdt.core.javascriptValidator&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;buildCommand&gt; &lt;name&gt;org.eclipse.wst.common.project.facet.core.builder&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;buildCommand&gt; &lt;name&gt;com.worklight.studio.plugin.WorklightProjectBuilder&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;buildCommand&gt; &lt;name&gt;org.eclipse.wst.validation.validationbuilder&lt;/name&gt; &lt;arguments&gt; &lt;/arguments&gt; &lt;/buildCommand&gt; &lt;/buildSpec&gt; </code></pre> <p>The .project file is located in the root of the Worklight project home (e.g. myproject/.project). I figured this out eventually, by running across a working project that did successfully call Java from JavaScript. </p> <p>See <a href="http://www.ibm.com/developerworks/rational/library/server-side-mobile-application-development-1/" rel="nofollow">http://www.ibm.com/developerworks/rational/library/server-side-mobile-application-development-1/</a></p> <p>I copied the code verbatim to my project and it had the same behavior as my code. I copied my code to that project and my code worked (!!). I then compared the classpaths, which were somewhat different, but it didn't change the behavior. I inspected the .project file and noticed my file didn't have the buildCommand tags above. Instead my file had a number of externalToolBuilding tags, presumably because one of the guys on my team uses an IDE other than Eclipse and his .project became the one in the project. (I think it's Sublime, if it matters). </p> <p>I don't quite understand all the details of what each of these tags do or exactly how and why Worklight and Eclipse change their behavior because of it (or why they disappeared in the first place). However, it made my code work. It only cost me a week's worth of work (ack!). </p> <p>I hope this helps someone else in the future.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload