2.10. Deploying Java & HelloServer

We are now ready to start deploying bundles into our 'dev' environment using the bw deploy command.

We'll start with the loadable 'jdk' bundle, and then continue with version 1.0 of the sample 'helloserver' bundle (an executable bundle). Issue the following commands to deploy these bundles into the 'dev' environment. Use your jdk version in place of 1.5.0_07.

Version 1 of the HelloServer application is a simple java application that listens on a particular port and outputs a 'hello' message to anyone that connects. When you deploy this HelloServer application, you are prompted to select a port number. Accept the default of 31001.

bw deploy $HOME/works/bundles/jdk/1.5.0_07 $HOME/works/environments/dev
bw deploy $HOME/works/bundles/helloserver/1.0 $HOME/works/environments/dev

If you look inside the '$HOME/works/environments/dev' directory, you will see the result of the above deploy commands. The jdk will be installed as a reference inside the 'uses' directory. The helloserver installation goes in its own directory which contains a 'work' directory. This 'work' directory will be used by helloserver for configuration and logs. This defines an independent instance of helloserver.

The bw list deployed command will show you where bundles have been deployed. You output will look similar to the following:

$ bw list deployed
/home/admin/works/environments/dev
   helloserver -> /home/admin/works/bundles/helloserver/1.0
   jdk -> /home/admin/works/bundles/jdk/1.5.0_07

The bw whereis command is similar to the UNIX 'whereis' command. In BundleWorks, it will show the location of any matching bundle, either available or deployed. For example, if you type bw whereis helloserver, you will see both the available and deployed helloserver bundle, similar to the following:

$ bw whereis helloserver
Available
   /home/admin/works/bundles/helloserver/1.0
Deployed
   /home/admin/works/environments/dev (/home/admin/works/bundles/helloserver/1.0)