Example Development Environment¶
This section describes the step-by-step process for setting up the development environment that was used to develop and test many of the procedures in this Guided Tour. A rich set of tools exist to support Java development, so this is by no mean the only development environment possible.
As of version 18.104.22.168, the Delphix Masking Engine's JVM version is 8, so it's important to build a plugin compatible with Java 8.
Downloading and Installing Tools¶
- Download and install the Oracle Java JDK or OpenJDK from the AdoptOpenJDK Project. Make sure you install Java 8 version.
- Download and install IntelliJ IDEA Community Edition for your OS. These instructions are known to work for version 2019.3.
Creating a new Project¶
Identify the root directory of your project code. For example, if you used these instructions to create a new project, this directory is referred to as proj_dir.
Start IntelliJ IDEA. A pop-up should appear.
- Select Project Settings > Project > Project SDK > New > JDK
- Provide the path to the JDK you installed earlier (e.g. /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home). Select OK.
- For Project language level, set to "8 - Lambda, type annotations etc."
- In the IntelliJ IDE, select Import Project from the pop-up.
- Provide the path to the root of your project, for example, proj_dir.
- Select Import project from external model and Gradle, and then select Next.
- After the project is imported, a directory tree is shown on the left panel.
At this point, the development environment should be ready to use.
Enabling Remote Debugging¶
It is often useful to enable remote debugging, which allows the IDEs debugger to attach to a running maskApp or maskScript process. To enable remote debugging, certain environment variables must be set. In both cases, the value 5005 can be replaced with the value of any open TCP port.
MASK_APP_OPTS='-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005'
MASK_SCRIPT_OPTS='-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005'
These settings will cause the maskScript to suspend at startup to allow time to attach the debugger.