The following are a demonstration of how to create a program with execJ
The execJ examples and source code are included in a sample directory inside the execJ directory which is usually located at C:\Program Files\execj\sample
HelloWorld
This example is a basic HelloWorld program showing a JFrame. This application is packaged as an executable jar file. Please follow these steps.
- Load the HelloWorld.ejp file in execJ and look over the settings.
- Go to the build tab to build the project.
- The application is built as an exe in the build directory.
- You can start the application from within execJ or navigate to the build directory in windows explorer to double click it.
ServiceDemo
This example demonstrates how to create a windows service java application. Please follow these steps.
- Load the ServiceDemo.ejp file and look over the settings.
- Go to the build tab to build the project.
- The application is built as an exe in the build directory.
- Click "Add & Start Service" which will add your exe as a service and start it. Alternatively, you can open a command prompt and execute a command like
myexe.exe -addService -noauto -startService
- In the exe's directory, an execJservice.txt log file is written to.
- Open your Windows Services in the Control Panel. Try pausing and resuming the service from there and watch the logs detect the events.
- You can then click "Stop & Delete Service" which will terminate the service and remove it from the service list.
Note: If using Windows Vista, you will need to change your build directory to something not in Program Files due to new security procedures preventing the writing to that directory.