Forum: Building VoltDB Applications

Post: Hello World Example

Hello World Example
ajgent
Apr 9, 2010
Several people have commented on the fact that the Hello World application in the examples folder does not have an Ant build file. Unfortunately, the README for that application was accidentally left out of the recent kits. You will find the text of the README at the end of this post.

Just as a quick explanation: Hello World is the application described in the Getting Started tutorial. Its purpose is to familiarize new users with the structure of a VoltDB application and the build process. Where normally in development you want to automate the build process as much as possible, Hello World does not include a build script since understanding the individual steps is one of the goals of the tutorial.


The sources for the Hello World application are included in the examples folder for those who want to follow along with the tutorial but save themselves some typing. The missing README includes the shell commands necessary to build and run the application "by hand".


We apologize the the confusion the missing README caused and will make sure it is included in future releases. In the meantime, the following is the text of the README for helloworld:

This directory contains the source files for the Hello, World! tutorial described in Getting Started with VoltDB.

Please note that there is no ant build file provided with these source files, because the tutorial is designed to familiarize you with the commands to write and compile VoltDB applications. The commands you need to process these files are the following:

$ export CLASSPATH=.:../../voltdb/*

$ javac Client.java
$ javac Insert.java
$ javac Select.java
(compile application catalog)

$ java org.voltdb.compiler.VoltCompiler project.xml 1 1 localhost helloworld.jar
(create database)

$ java -Djava.library.path=../../voltdb/ org.voltdb.VoltDB catalog helloworld.jar
(in separate window, run client application)

$ java Client