Setting up a Java Development Environment
Setting up a Java Development Environment
Prerequisites
Before setting up your GPSS client development environment, ensure that you have:
- Access to a system on which you can develop code.
- Administrative access to your development system.
Example Procedure for Java
Perform the following procedure to set up a GPSS client Java development environment. This procedure assumes a Linux-based development system.
- If not already present on your development system, install Java Development
Kit version 1.8. You must have superuser permissions to install
operating system packages. For example, to install the JDK on a CentOS
development system:
root@devsys$ yum install java-1.8.0-openjdk-1.8.0*
- If it is not already installed on your development system, download the protocol buffer compiler version 3, and follow the installation instructions in the README.
- Create a work directory. For example:
user@devsys$ mkdir gpss_dev user@devsys$ cd gpss_dev user@devsys$ export GPSSDEV_DIR=`pwd`
Examples in this guide reference your work directory. You may consider adding $GPSSDEV_DIR to your .bash_profile or equivalent shell initialization script.
- Download the gRPC Java code generation plugin and example code by cloning its
repository. For example:
user@devsys$ git clone https://github.com/grpc/grpc-java.git
The command clones the repository to a directory named grpc-java in the current directory.
- Prepare the work directory for Java development. Create directories
for the source code and the gpss.proto service definition
file. For example:
user@devsys$ mkdir -p client/src/main/java user@devsys$ mkdir client/src/main/proto
- Navigate to the proto directory and copy the
gpss.proto service definition file to this directory.
Refer to GPSS Batch Data API Service Definition
if you have not already created the file.
For example:
user@devsys$ cd client/src/main/proto user@devsys$ cp <dir>/gpss.proto .
- Navigate back to your work directory:
user@devsys$ cd $GPSSDEV_DIR