Developing Series 40 apps on Linux
This article explains how to use the Nokia Java SDKs under Linux with WINE.
Note: This is an entry in the Asha Touch Competition 2012Q3
It is fully possible to develop Java ME and Series 40 Web Apps on Linux. The Web Apps development environment is available as a native applications for Linux (.deb package for Ubuntu/Debian) and does not require anything extra. Java ME apps can be developed in Netbeans (or Eclipse) and tested using the Oracle/Sun Java ME device emualtors available in the Jave ME SDK. The emulator is also avaiable integrated with your Netbeans installation.
Unfortunately the Nokia Series 40 SDK are not available as native Linux applications so integration with the Netbeans IDE is not possible. But, thanks to Wine, that lets you run Windows software under Linux, it is possible to still run the Nokia device emulation environments on Linux. Obviously this is only possible on 32-bit i386 Linux environments.
To start with you need to install a bit of software on your system first. Install, in order:
First you need to have Wine installed on your Linux system. How that is done depends on your distribution, but for example under Ubuntu or Debian, this should do the trick:
apt-get install wine1.4
Check the Wine download page for instructions and packages for other distributions.
Optionally, if you prefer to build wine from sources yourself, you can download the sources and do the autoconf/make dance:
tar zxvf wine-1.4.1.tar.bz2 cd wine-1.4.1 ./configure --prefix=/opt/wine-1.4 make && make install
The SDK need a Java environment to run. It needs to be the Windows version, download the 32-bit Java SE 6 Update 33 JRE off-line installer for Windows, jre-6u33-windows-i586.exe.
Now drop to a terminal (or depending on your distribution, double-click the .exe and wine should start it automaticaly) and cd to the location where you saved the jre installer. Then run it with wine:
Click through the normal installation wizard and the JRE should now be installed on your wine system.
Nokia Java SDKs
Now you can install the Nokia Java SDKs, available for download here. I've installed and tested versions 1.1 and 2.0(beta) succesfully. Start the SDK installers the same way as you did the the JRE and click trough the install wizard again.
And depending on your Linux environment, you should have the emulator icons on your desktop.
Now you should be able to start the emulator using Wine
The Nokia SDK 2.0 comes with a device emulator and an IDE (Eclipse). The IDE will run under Wine, but unfortunately something prevents it from seeing the installed SDKs and device emulators and because of that refuses to create a MIDlet project without a device emulator configured. The solution is to use native Netbeans IDE, it can't use the Windows based device emulators directly, but fortunately the emulators have a Open... option in the file menu so we are able to start the Java ME .jar files ourself. (And also Open url... you can use that option to test Web apps on the device native browser!)
To make easier to find the built .jar files from the emualtors I made a symlink from the wine environment to my Netbeans installation, like this:
user@dummy:~$ cd .wine/drive_c/ user@dummy:~/.wine/drive_c$ ln -s /home/user/NetBeansProjects
As the SDKs won't integrate with the native Netbeans, you need to add any extra .jar files (for example the Maps API or other Nokia SDK specific libraries) yourself to your project from the Project Properties -> Libraries & Resources tab.
Testing Java apps
Now you should have everything you need. You can test the emulators by creating a Hello World app in Netbeans and then opening the .jar from the emulator.
Series 40 Web apps
As mentioned in the introduction, the Web Apps development environment is available as a native Linux applications. Everything should work fine under Linux using it and you can follow directly any documentation available.
Testing your web apps can be done directly in the IDE, using local or cloud based preview. These are not perfect emulations of the Nokia Browser on the real devices, but as far as I know, the device emulators that come with the Java ME SDKs have the real native browsers installed. It is possible to test Web Apps under the device emulators, copy&paste the URL given by the Web Tools when deploying and use the Open url... option in the emulators.
Now you should be able to develop and test Java ME apps under Linux with the Nokia Series 40 device emulators! Enjoy.