Exercise 0: Install and Configure Lab Environment

For JavaOne attendees using the lab machines provided, the steps in Exercise 0 are done for you as part of the login process. So please proceed to Exercise 1.

  1. Load the Sun SPOT Manager Java Webstart tool.
    • If this is the first time you have run this tool, your system will be scanned to make sure you have all the required software installed.
    • Once the Configuration check is complete, you will see a 'Success' screen and you can continue with the installation process
    • Click 'OK' to continue to the installation screen
    • Select the 'SDKs' Tab, and then select the 'v3.0 Purple' SDK from the 'Available SDKs' list.
    • Click the 'Install' button, accept the license agreement, and choose an installation location
      • Note: it is not advised to have a space in your path to the Sun SPOT SDK installation directory
    • If all went well, you should now have an installed Sun SPOT SDK listed in your Sun SPOT Manager Tool.
  2. Start the NetBeans 6.0.1 IDE and see if the IDE comes up.
    • On Windows, Start > Programs > NetBeans IDE > NetBeans IDE 6.0.1 > NetBeans IDE or click NetBeans 6.0.1 desktop icon
    • On Solaris, UNIX, or Linux, open a terminal window, then type <netbeans601_HOME>/bin/netbeans
    • On Mac OS X start Applications-->NetBeans 6.0.1.app
  3. Make sure the NetBeans Sun SPOT Modules are installed
    • Download the NetBeans Sun SPOT Update Center .nbm
    • Select "Tools-->Plugins" and click the 'Downloaded' Tab, and the 'Add Plugins...' button. Find where your browser downloaded the com-sun-sunspot-updatecenter.nbm file and select it.

      Note: Some browsers may rename the file after downloading with a '.zip' or other suffix. Rename the file to end in '.nbm' in order to be able to select it.
    • Select the SunSPOTsModuleUpdateCenter and click 'Install'

    • You can accept all the default values in the subsequent screens
    • Click on the 'Available Plugins' tab, and click the 'Reload Catalog' button, then click the 'Name' column to sort the modules by their names.

    • Select all the Sun SPOT Modules
      • SpotRenameRefactoring
      • SunSpotApplicationTemplate
      • SunSpotHostApplicationTemplate
      • Sun SPOTs Info
    • The Modules are unsigned, so you will be required to 'trust' them before installing.
    • When the modules are properly installed you will see the Sun SPOT Info Module Button in your toolbar:

  4. Make sure that your Sun SPOTs are running the same version of the software, and upgrade if necessary.
    • This lab is based on the v3.0 (Purple) version of the Sun SPOT SDK, which you should have installed in step 1 above.
    • Make sure your Sun SPOTs are plugged in, and click on the Sun SPOTs tab.
    • Select any Sun SPOT, and click the 'SPOT Info' button. If you see the following, you will need to update the software on your Sun SPOTs:
      -run-spotclient-once:
      [java] SPOT Client starting...
      [java] [waiting for reset] Exiting - detected bootloader command
      [java] [waiting for reset] 
      [java] [waiting for reset] 
      [java] [waiting for reset] ** VM stopped: exit code = 0 ** 
      [java] [waiting for reset] 
      [java] WARNING: SPOT does not have current SDK installed. Please upgrade it
      [java] 
      [java] Sun SPOT bootloader (blue-080318) 
      [java] SPOT serial number = 0014.4F01.0000.059E
      [java] 
      [java] Error: SPOT does not have current SDK installed. Please upgrade it
      [java] 
      [java] The SPOT client will now exit
      [java] Experimental:  JNI_OnLoad called.
      ******************************
      SPOT Command Completed!
      ******************************
    • Select 'All Sun SPOTs' from the pull-down menu, and click 'Upgrade'. You may need to reset each SPOT in turn during the upgrade process, so watch the output window for instructions.
  5. Try running the Sun SPOT Emulator to ensure that your Sun SPOT Environment is working correctly
    1. Click the 'Solarium' tab in your Sun SPOT Manager tool

    2. If you have Sun SPOTs plugged in you should see them available in the 'Select a Sun SPOT' drop-down menu. For this exercise, select 'Virtual SPOTs'


    3. Click the 'Solarium' button
    4. Select 'Emulator-->New Virtual SPOT'

    5. Right-click on the Virtual SPOT and choose 'Specify Application jar File'

    6. Find the Sun SPOT Emulator Demo Jar and select it

    7. Right-click on the Virtual SPOT and select 'Run Midlet' and choose a midlet to run

    8. If you are able to get all of this done, your Sun SPOT SDK Installation is likely to be ok, but if you have a physical Sun SPOT handy, plug it in to your computer and click on the 'Sun SPOTs' tab in Sun SPOT Manager.
    9. Select your Sun SPOT from the 'Select a Sun SPOT' drop-down menu

    10. Click the 'SPOT Info' button to see the configuration of your Sun SPOT

    11. If you see output indicating that your SDK does not match that installed on the Sun SPOT, click the 'Upgrade' button to update the software on your Sun SPOT.

Go on to next exercise