In this section, you will learn more about running VJET programs in the workbench.
- Please make sure the VJET file MyTest.js is opened in your editor area.
-
You can copy the following code and insert them into props.
Note: add the method before the closing brackets of the block.
//>public void main(String... args)
main : function(args){
new this.vj$.Test(true, 0).setClose();
vjo.sysout.println("Hello World");
}
-
From Script Explorer view, select Test.js file, Right click on it.
From context menu, select Run As > VJET JS Application.
Note: the Run As context menu is also available in other places.
-
The program will print two messages in your Console view if it run successfully.
One is "Your account has been CLOSED!" and the other is "Hello World".

-
To specify arguments, use the drop-down Run menu in the toolbar and select Open Run Dialog....
Or you can also go through Context menu. Run As > Open Run Dialog...

-
This time, the Launch Configurations dialog opens with the MyTest launch configuration selected.
A launch configuration allows you to configure how a program is launched,
including its arguments and other options. (A default
launch configuration was created for you when you chose Run >
VJET JS Application).

- Replace the following code of the main method :
//>public void main(String... args)
main : function(){
var x = arguments;
var size = x.length;
vjo.sysout.println("Argument size:" + size);
vjo.sysout.println("-first:" + x[0]);
vjo.sysout.println("-second:" + x[1]);
}
-
Select the Arguments tab and type Hello World in the Program arguments area.

-
Click Run.
The program will print three messages if it run successfully.
-
Switch to the Debug perspective. In the Debug view, notice that a process for the last program launch was registered when the program was run.
By default, the Debug view automatically removes any terminated launches when a new launch is created.
You can reach this perspective throuth Window menu > Open perspective > Other.. > Debug

Note: You can relaunch a terminated process by selecting Relaunch from its context menu.
-
Select the drop-down menu from the Run button in the workbench toolbar.
This list contains the previously launched programs.
These programs can be relaunched by selecting them in the history list.

-
From the context menu in the Debug view (or the equivalent toolbar button),
select Remove All Terminated to clear the view of terminated launch processes.
