Break Point ignored while debugging Nashorn Javascript

Hi I have a small project and want to debug a Nashorn Javascript with Intellij 13.1 Ultimate Edition. The break point is shown in the Javascript, but the debugger does not stop at the break point while debugging.

Please find following the java class and the javascript. I am running Intellij 13.1 on Redhat Linux 6 64-Bit with the SDK 1.8.0 64-Bit.


import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public class ExecuteJavascript {

    public static void main(String[] args) throws Exception {
        ScriptEngineManager scriptEngineManager = new ScriptEngineManager();
        ScriptEngine scriptEngine = scriptEngineManager.getEngineByName("nashorn");

        if (null == scriptEngine) {
            throw new Exception("No Nashorn!");

        InputStream scriptFile = ExecuteJavascript.class.getResourceAsStream("UUIDGenerator.js");

        if (null == scriptFile) {
            throw new Exception("JavaScript file HelloWorls.js not found");

        scriptEngine.eval(new InputStreamReader(scriptFile));

var requestUuid = null;

if (!requestUuid) {
    var uuid = generateUUID();

function generateUUID() {
    var d = new Date().getTime();
    var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = (d + Math.random()*16)%16 | 0;
        d = Math.floor(d/16);
        return (c=='x' ? r : (r&0x7|0x8)).toString(16);
    return uuid;

Comment actions Permalink

Hi, when you load js script as a stream, there is no way in the debugger to map it back to the script file.
Please use approach like this:
and it will work.

Comment actions Permalink


Thanks for your support!


Comment actions Permalink

Is this the only form of the load that one can use to debug Nashorn JS in Intellij? That is


?? I have tried it (and would be interested to use it) via other methods such as


which evals properly, but does NOT enable debugging. Also,


also evals properly but also does NOT enable debugging.

The problem is that the JS files may be remote to the project (which is why Nashorn supports pulling them in from elsewhere on the file system). If they are remote to the Intellij Project, one (apparently) cannot debug them via Intellij IDEA.

Why this restriction? Anyone know of any workarounds to enable other forms

thank you

Comment actions Permalink

3 issues were closed recently –,, Will be available in next IDEA 14.1 EAP. If you want, I can send you pre-EAP built to test.

>> If they are remote to the Intellij Project, one (apparently) cannot debug them via Intellij IDEA.
Feel free to file issue about it and it will be fixed soon.

Comment actions Permalink

Yes please send. Thank you for the prompt response!!! (I'm at


Please sign in to leave a comment.