Sunday, February 28, 2010

Java ME on Arch Linux x64

I was trying to setup Java ME on my machine running 64-bit Arch. It wasn't a smooth process. This is a list of problems I encountered:

  1. The Java ME SDK 3.0 isn't available for Linux (yet). Had to settle for Sun Java Wireless Toolkit 2.5.2 for CLDC
  2. I have a 64-bit version of JDK installed on Arch. Java ME can't work with this. It throws a java.lang.UnsatisfiedLinkError: /opt/WTK2.5.2/bin/ /opt/WTK2.5.2/bin/ wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
  3. To fix this, I installed bin32-jre from the AUR
  4. Then edited the /opt/WTK2.5.2/bin/emulator file (path depending on where you've installed it), and changed the javapathtowtk to /opt/bin32-jre/jre/bin/
  5. Restarted NetBeans, tested a simple project and it worked!

(Note: The Java ME installer asks for a java path during installation. It may be possible to point it to bin32-java during this time)


antonio said...

Hola Men,muchas gracias por la info, estoy ocupando arch y me sirvio

Anonymous said...

Genial, me ha venido de perlas la info. Muchas gracias.

milly0 said...

thanks!! i was killin ma self over this :D

Fabiano said...

Oh, good. It's running in my Netbeans now. Thanks. ;-)