Developing Series 40 apps on Linux
This article explains how to use the Nokia SDK 2.0 for Java and Nokia Asha SDK 1.0 under Linux with WINE.
Article Metadata
Tested with
Compatibility
Article
Contents |
Introduction
It is fully possible to develop Java ME and Nokia Asha 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 emulators available in the Jave ME SDK. The emulator is also available 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.
Installation
To start with you need to install a bit of software on your system first. Install, in order:
- Wine
- Java JRE for Windows
- Nokia Series 40 SDKs that you need
- NetBeans
Wine
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.
From source
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
JRE 7
The new Asha SDK needs JRE 7, but you must install an older version, JRE 7 u17, as the emulator refuses to start if any later is installed. Download from Oracle or use google to find jre-7u17-windows-i586.exe.
JRE 6
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 automatically) and cd to the location where you saved the jre installer. Then run it with wine:
wine jre-6u33-windows-i586.exe
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 had problems with the on-line installers, downloads got stuck, so I recommend using the larger off-line versions.
I've installed and tested versions 1.1, 2.0 and the Asha SDK 1.0 successfully.
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(s) as any other program.
Preparations
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 emulators 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.
Conclusion
Now you should be able to develop and test Java ME apps under Linux with the Nokia Series 40 device emulators! Enjoy.


Contents
Hamishwillee - Very nice indeed
This article is that it opens up Series 40 Java ME development to a huge number of developers who won't bother on a windows-only toolchain. That has got to be "a good thing", so I would value this highly on the "highly reusable" scale.
The document is still marked under construction - what do you plan to do to extend it, and when? When you're done, please remove this template and I'll subedit (time permitting)
Just to confirm my understanding,
I note that in "Testing Web Apps" you suggest copy-pasting into the emulator. Does this mean that even though you say "The Web Apps development environment is available as a native applications for Linux (Ubuntu) and does not require anything extra" it is not possible to automatically run and debug web apps on linux in this native environment ... or are you saying this is just another way you can test web apps.
Regards
Hamishhamishwillee 09:51, 8 August 2012 (EEST)
Oniongarlic - Thank you for the feedback
I'm still learning myself what works best. I'll try to clarify the points you brought up. Thanks.oniongarlic 10:09, 9 August 2012 (EEST)
Hamishwillee - Good job on clarifications
Thank you. Makes sense.hamishwillee 04:35, 4 September 2012 (EEST)
Ariestiyansyah - Fedora
Yeah. Web apps running on ubuntu, but not for fedora T.T . so i just waiting for fedora version for the Nokia web tools.
can't wait :3ariestiyansyah 16:21, 11 March 2013 (EET)