Skip to content
Vladimir Schneider edited this page Sep 13, 2015 · 3 revisions

Troubleshooting

Script Monkey Plugin causes exception: Could not load Script Engine

The nashorn.jar files is needed to run this plugin. This error means that the boot jdk for the IDE does not have this library included. You will need to change the boot jdk for the IDE to use this plugin, see Changing Boot JDK

Script Monkey Plugin is working but global variables are missing

If you type alert in the Script Monkey JS Shell tool window prompt then hit enter you should see the listing of the alert function:

js>alert
function alert(msg, title) {
    var JOptionPane = javax.swing.JOptionPane;
    msgBox(msg, title, JOptionPane.INFORMATION_MESSAGE);
}
js>

If instead you get:

js>alert
ReferenceError: "alert" is not defined in <Script Monkey JS Shell> at line 1
js>

This means that the global initalization script files are missing from the user HOME directory. On IDE startup, the plugin will copy its JS script library to the USER_HOME directory under scriptMonkey subdirectory. After the first run you should find the following under the system dependent user HOME directory:

scriptMonkey
└── js
    ├── global
    │   ├── gui.js
    │   ├── gui.js.bak
    │   ├── init.js
    │   ├── init.js.bak
    │   ├── intellij.js
    │   └── intellij.js.bak
    ├── lib
    │   └── trimpath.js
    ├── plugin-script
    │   ├── codespointer.js
    │   ├── codespointer.js.bak
    │   ├── timebar.js
    │   ├── timebar.js.bak
    │   ├── tools.js
    │   └── tools.js.bak
    └── samples
        ├── AntVersion.js
        ├── AntVersion.js.bak
        ├── BackupProjectFolder.js
        ├── BackupProjectFolder.js.bak
        ├── EchoEnvironmentVariables.js
        ├── EchoEnvironmentVariables.js.bak
        ├── FileStatistics.js
        ├── FileStatistics.js.bak
        ├── HelloRhino.js
        ├── ZipAndEmailProject.js
        └── ZipAndEmailProject.js.bak

5 directories, 24 files

If these files are missing then the global variables that are created by these scripts will be missing. These files are stored in the js.jar in the plugin's zip distribution file.

As a workaround you can extract the files from js.jar (it is just a zip file with a different extension) into the user HOME directory.

It would also help if you make report a quick bug report on the Script Monkey Issues page that this installation problem has occurred for your system configuration. Please let us know your IDE type, version number and the boot JDK version, a screenshot of the about dialog will have all the needed information so you can just include that and the version of the plugin that you have installed. You can find it in the IDE settings under Settings > Plugins by selecting Script Monkey from the installed plugins list. The installed version will be at the top of the information pane for the plugin.