Eclipse & jrunscript: Auto completion

To get jrunscript auto completion working inside Eclipse, there are only a few steps needed. First the source code (including JSDoc) of the used JDK has to be extracted. Jrunscript's global functions and objects are located in the init.js file which is part of the tools.jar. For my Win7 / Cygwin setup I used the command line:

unzip -p $(cygpath -au "C:\[PATH_TO_JDK]\\lib\tools.jar") 
 com/sun/tools/script/shell/init.js > init.js

After storing the init.js to a directory, there is time to configure Eclipse. First the file has to be linked as an user library:


Second, the JavaScript build path has to be configured, by adding the just created user library:



Finally the auto completion should work inside the JavaScript editor (including JSDoc):


No comments:

Post a Comment