Let's write a first Sun SPOT application for Servo Car! Typically, Java IDE (like NetBeans) is very useful to write a large Sun SPOT application and I usually use it. However, to make things easy, let's begin with minimal developing environment -- Sun SPOT SDK, your favorite text editor & terminal.
Sun SPOT SDK has a color name according to its version. The current stable version (as of 5/23/2008) is v3 ("Purple" release), so let's use this version for the demo.
If you have a Sun SPOT Java Development Kit with Purple SDK CD-ROM, you may install it from CD. Otherwise, you can install SDK from http://www.sunspotworld.com/spotmanager/. This site keeps many different SDK versions other than Purple (v3) including beta versions, so I recommend the latter and will explain how to install SDK by using this site.
How to install Sun SPOT SDK
- access http://www.sunspotworld.com/spotmanager/ and click the Sun SPOT icon to launch Sun SPOT Manager tool
- Select "SDKs" tab
- Select purple-071018 (it may be labeled "Purple Beta RC5") from Available SDKs. If you don't see any versions in it, press "Refresh" button under Available SDKs.
- Press "Install" and "Sun SPOTs SDK Installer Tool" will be launched.
- Accept defaults other than "New SDK Directory Location". If you're a Windows user, it may begin with "C:\Program Files\Sun ..". There is no problem with this to develop Sun SPOT applications. But if you use Sun SPOT emulator, it causes some problems. So change this location ("C:\Program Files\Sun ..") to other place (e.g. "C:\Sun .."). For details, please refer to https://www.sunspotworld.com/forums/viewtopic.php?p=2809.
- Press "Install". After installing, press "Done".
- You should see the installed SDK on "Installed SDKs" panel.
To confirm your installation, connect a Sun SPOT to PC via USB cable , open your favorite terminal emulator and check the following command output.
$ cd $(SDK_DIRECTORY_LOCATION) <- specify your directory
"ant info" checks the connected Sun SPOT information. If you see the same output as the above one, congratulations! Your installation was successful.