Skip to content

Latest commit

 

History

History
59 lines (34 loc) · 1.58 KB

netbeans.md

File metadata and controls

59 lines (34 loc) · 1.58 KB

Testing Nashorn scripts with Netbeans IDE 8.2

Netbeans IDE allows you to run and debug your Nashorn scripts.

Requirements

To run the latest version of Nashorn, we need to install JDK 1.8: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

Install

You can download Netbeans IDE 8.2 from

Choose the Java EE edition because it includes JavaScript.

Create a new project

Click File --> New Project..

Select Java Application and click Next.

New project - step 1

Deselect Create Main Class and click Finish.

New project - step 2

Add a new JavaScript file. Rightclick on Source Packages. Choose New --> Other.

New project - add file

Input a filename and click Finish.

New project - create file

Now we can create our first Nashorn script. This line of code should work.

print('Hello world');

Rightclick inside your file and click Run File.

New project - run file

Congratulations, You've just created your first Nashorn script!

To continue, there are two options:

  1. Learn more about Nashorn scripting
  1. Lean more about Nashorn scripts for SQLcl with Netbeans