Nashorn breakpoints
I was trying out some of the new features in IDEA 13.1.1 (Build #IC-135,480 March 21, 2014) and can't debug a simple nashorn example.
Java code (NashornDemo.java):
<code>
package demo;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.FileNotFoundException;
import java.io.FileReader;
public class NashornDemo {
public static void main(String[] args) throws ScriptException, FileNotFoundException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName("nashorn");
engine.eval(new FileReader("src/demo/hello.js"));
}
}
</code>
JS code (hello.js):
<code>
print("Hello World!");
</code>
I can set a breakpoint in the java file properly, but the IDEA editor won't let me set a breakpoint in the JS file. Is there something I have to do or some sort of run option needed to do this. I was trying to follow this blog:
http://blog.jetbrains.com/idea/2014/03/debugger-for-jdk8s-nashorn-javascript-in-intellij-idea-13-1/
Thanks!
JS code (hello.js):
<code>
print("Hello World!");
</code>
I can set a breakpoint in the java file properly, but the IDEA editor won't let me set a breakpoint in the JS file. Is there something I have to do or some sort of run option needed to do this. I was trying to follow this blog:
http://blog.jetbrains.com/idea/2014/03/debugger-for-jdk8s-nashorn-javascript-in-intellij-idea-13-1/
Thanks!
请先登录再写评论。
Forgot to mention that it is running on windows 8 x64 and java:
java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) 64-Bit Server VM (build 25.0-b70, mixed mode)
Enable JavaScript Debugger plugin.
I thought it would be something simple like that ... but where do I enable the JS plugin? It's not in the default list in Settings->Plugins and I can't find it if I click on 'Install JetBrains Plugin' or 'Browse Repositories'. Also looked in the Debugger and Run/Debug settings.
Are you using IntelliJ IDEA Community Edition?
Looks like it works only in Ultimate Edition now. I suggest you to file a request to make JS breakpoints work in Community Edition: http://youtrack.jetbrains.com/issues/IDEA
Ok, that wasn't made very clear in this list:
http://www.jetbrains.com/idea/whatsnew/
It's under the general section and should probably be labeled with 'Ultimate'. I'll add the request. Thanks.
FYI:
http://youtrack.jetbrains.com/issue/IDEA-123020