Virtual Machine Image¶
To use the Virtual Machine image:
- Download and install either Oracle VirtualBox or VMWare player to your environment.
- Download the CDAP Standalone Virtual Machine (Standalone VM) at http://cask.co/downloads/#cdap.
- Import the downloaded
.ovafile into either the VirtualBox or VMWare Player.
The CDAP Standalone Virtual Machine is configured with the recommended settings for Standalone CDAP:
- 4 GB of RAM
- Ubuntu Desktop Linux
- 10 GB of disk space
It has pre-installed all the software that you need to run and develop CDAP applications:
- Java JDK 7 or 8 and Node.js are both installed.
- Maven is installed and configured to work for CDAP.
- The Standalone CDAP SDK is installed under
3.3.7and will automatically start when the virtual machine starts.
- Both IntelliJ and Eclipse IDE are installed and will start when the virtual machine starts.
- The Firefox web browser starts when the machine starts. Its default home page is the CDAP UI,
No password is required to enter the virtual machine; however, should you need to install or
remove software, the admin user and password are both
Development Environment Setup¶
Creating an Application¶
When writing a CDAP application, it’s best to use an integrated development environment that understands the application interface to provide code-completion in writing interface methods.
The best way to start developing a CDAP application is by using the Maven archetype:
$ mvn archetype:generate \ -DarchetypeGroupId=co.cask.cdap \ -DarchetypeArtifactId=cdap-app-archetype \ -DarchetypeVersion=3.3.7
This creates a Maven project with all required dependencies, Maven plugins, and a simple application template for the development of your application. You can import this Maven project into your preferred IDE—such as IntelliJ or Eclipse—and start developing your first CDAP application.
For an application that contains a MapReduce program, use
instead; for Spark, use either
- Open IntelliJ and import the Maven project.
- Go to menu File -> Import Project...
- Select the
pom.xmlin the Maven project’s directory.
- Select the Import Maven projects automatically and Automatically download: Sources, Documentation boxes in the Import Project from Maven dialog.
- Click Next, complete the remaining dialogs, and the new CDAP project will be created and opened.
- In your Eclipse installation, make sure you have the m2eclipse plugin installed.
- Go to menu File -> Import
- Enter maven in the Select an import source dialog to filter for Maven options.
- Select Existing Maven Projects as the import source.
- Browse for the Maven project’s directory.
- Click Finish, and the new CDAP project will be imported, created and opened.
Starting and Stopping Standalone CDAP¶
cdap.sh script to start and stop the Standalone CDAP
(the location will vary depending on where the CDAP SDK is installed):
$ cd cdap-sdk-3.3.7 $ ./bin/cdap.sh start . . . $ ./bin/cdap.sh stop
Or, if you are using Windows, use the batch script
cdap.bat to start and stop the SDK.
Note: There is an issue with running Microsoft Windows and using the CDAP Standalone scripts
JAVA_HOME is defined as a path with spaces in it. A workaround is to use a
JAVA_HOME that does not include spaces.
Note that starting CDAP is not necessary if you use either the Virtual Machine or the Docker image, as they both start the Standalone CDAP automatically on startup.
Once CDAP is started successfully, in a web browser you will be able to see the CDAP