简体   繁体   中英

How to debug a Java project's JavaScript files inside Netbeans 8 itself ?

In Netbeans 8: a new HTML5 project using AngularJS online template lets me runs the html files with the debugger attached to browser and I can set breakpoints inside Netbeans JavaScript files to debug. Which makes things ALOT easier.

But when I create a Java maven based web project with AngularJS dependencies I have to use the browser's code viewer to debug the Javascript code. Which is more time consuming.

How can I debug JavaScript files inside Netbeans instead of debugging in the browser for a Java maven based web project ?

You don't / can't directly. While it is possible to run a Java based Javascript interpreter you won't have access to any browser windows or DOM elements. Instead, you almost certainly want to use EmbeddedBrowser to launch and control Firefox, Safari and/or IE depending on which you wish to test with in Netbeans. Note that it's running an external process to do this, and I don't think you'll be able to access the browser developer tools from within the embedded environment (which is what I normally use when debugging Javascript).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM