🔗Virtual Machine Image

To use the Virtual Machine image:

The CDAP Standalone Virtual Machine is configured with the recommended settings for Standalone CDAP:

  • 4 GB of RAM
  • Ubuntu Desktop Linux
  • 40 GB of virtual disk space

It has pre-installed all the software that you need to run and develop CDAP applications:

  • The Standalone CDAP SDK is installed under /opt/cdap/sdk and will automatically start when the virtual machine starts.
  • A Java JDK is installed.
  • Maven is installed and configured to work for CDAP.
  • Both IntelliJ IDEA and Eclipse IDE are installed and available through desktop links once the virtual machine has started.
  • Links on the desktop are provided to the CDAP SDK, CDAP UI, and CDAP documentation.
  • The Chromium web browser is included. The default page for the CDAP UI, available through a desktop link, is http://localhost:9999.

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 cdap.

🔗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 \

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, set the archetypeArtifactId to cdap-mapreduce-archetype; for Spark, use either cdap-spark-java-archetype or cdap-spark-scala-archetype.

🔗Using IntelliJ

  1. Open IntelliJ and import the Maven project.
  2. Go to menu File -> Import Project...
  3. Select the pom.xml in the Maven project's directory.
  4. Select the Import Maven projects automatically and Automatically download: Sources, Documentation boxes in the Import Project from Maven dialog.
  5. Click Next, complete the remaining dialogs, and the new CDAP project will be created and opened.

🔗Using Eclipse

  1. In your Eclipse installation, make sure you have the m2eclipse plugin installed.
  2. Go to menu File -> Import
  3. Enter maven in the Select an import source dialog to filter for Maven options.
  4. Select Existing Maven Projects as the import source.
  5. Browse for the Maven project's directory.
  6. Click Finish, and the new CDAP project will be imported, created and opened.

🔗Starting and Stopping Standalone CDAP

Use the cdap.sh script to start and stop the Standalone CDAP:

$ /opt/cdap/sdk/bin/cdap.sh start
  . . .
$ /opt/cdap/sdk/bin/cdap.sh stop

Note that starting CDAP is not necessary if you use the Virtual Machine, as it starts the Standalone CDAP automatically on startup.

Once CDAP is started successfully, in a web browser you will be able to see the CDAP UI running at http://localhost:9999, where you can deploy example applications and interact with CDAP.

🔗Building and Running CDAP Applications

See Building and Running CDAP Applications for information on accessing the CDAP CLI and CDAP SDK bin utilities, building examples, starting CDAP, and deploying, starting, and stopping applications.