Note: These instructions are mainly for students of DIT (UoA).
Summary of what you are going to install to your computer:
- virtualbox extensions
You will install the following software inside the VM:
- IObit unlocker
Although you may use Windows or MAC OS as an operating system for your development computer, as a beginner it is recommended that you use a Linux-based distribution.
If you haven’t installed the OS read this article.
Here are the steps:
1) Update the repository (?)
sudo apt-get update
2) Install virtual box (?)
You can easily install virtual box via command line:
$ sudo apt-get install virtualbox $ sudo apt install virtualbox-ext-pack
In windows you just download and run the executable. Virtual box is a very stable software so you should not worry about encountering any problems at this point.
4) Download and import the OVA file
Download the OVA (Open Virtualization Format file) file provided by your instructors. You may have to use a VPN in order to do so. The specific OVA file cannot be offered for download by this site since it contains copyrighted software.
Once you download the image you should import it from within virtual box. In order to do so:
- Open VirtualBox
- Open menu item: File → Import appliance
- Select the ova file and import it (it may take a while if you have a slow computer)
Virtual box will create a virtual machine and configure everything for you. You do not have to make any changes to the virtual machine.
For screenshots on how to import an .ova you can refer to this article.
5) Software not to install
The provided OVA already contains an IDE (netbeans), a web browser (firefox) and a powerful text editor (ps-pad). You don’t need anything else.
If a notification prompts you to update netbeans, do NOT do so, as this may cause incompatibility issues with Solarium. You may update firefox or pspad if you wish though.
6) Recommended additional software
The following software is useful:
- IObit Unlocker
- Double commander (optional)
You need unlocker because the VM sometimes locks the jar files deployed in Solarium and netbeans cannot delete them (i.e. during a Clean & build). You could restart Solarium in order to unlock the jar files, but if you have configured many SunSpots it could be troublesome. Instead of restarting solarium, you can simply run unlocker and unlock the jar file(s). Then you can clean & build from within netbeans.
The generated jar files are located in …/suite/ subdirectory inside the project you are compiling.
7) Final advice
First, J2ME does not contain a fully implemented math library. So if you want to calculate power or logarithms you may have to do one the following:
- You can use a custom implementation like this one
- You can use the non standard MathUtils library of the squawk library (included in SunSPOT API):
Since MathUtils is included by Sun itself, it is the recommended approach.
Here are some important directories inside the virtual machine:
|Installation directory of SunSpot SDK||C:\Program Files\Sun\SunSPOT\sdk\|
|Code samples||C:\Program Files\Sun\SunSPOT\sdk\Demos\CodeSamples|
|Starting template||C:\Program Files\Sun\SunSPOT\sdk\Demos\CodeSamples\SunSpotApplicationTemplate|
Instead of starting a new project from scratch, you should copy the SunSpotApplicationTemplate project to another directory and start from there.
If you do decide to start from scratch you will have to write a couple of XML files which definitely does not worth neither the effort nor the time for this specific assignment.