Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java on OpenWrt/DD-WRT

Tags:

java

openwrt

I have an existing solution written in Java which I would love to run on OpenWrt routers. Will OpenWrt even run Java without installing a lot of dependencies? Anyone ever tried this?

like image 993
Hannes de Jager Avatar asked May 18 '10 11:05

Hannes de Jager


4 Answers

I've never done it, but it is definitively possible. You won't be able to run the full Java VM, only specialized versions of it (JamVM, PhoneME, SableVM). Also please be aware that running a Java VM is fairly a lot overhead for this kind of machine.

I won't get much in detail because others have already done it. Check out these links.

  • http://wiki.openembedded.net/index.php/Java
  • http://wolfpaulus.com/journal/embedded/fonera3
  • http://wolfpaulus.com/talks/openwrt.pdf
  • http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvancedGSGOpenWRT
  • http://www.oracle.com/technetwork/java/javame/tech/index-jsp-139293.html

EDIT: SableVM is unmaintained.

EDIT: As Amigable Clark Kant mentioned, you could compile your Java code to native by using the GNU Compiler for Java.

like image 200
orftz Avatar answered Nov 11 '22 07:11

orftz


Since your goal is to get the existing solution running on the router, and not explicitly get a JVM running on the router, I would suggest going the other way:

compile the Java code to native! This also has the potential to be just as fast a C code.

There is an article in Linux journal about this.

If not your cup of tea, JAMVM seems a better fit for a small system such as OpenWRT.

like image 42
Prof. Falken Avatar answered Nov 11 '22 09:11

Prof. Falken


I have done this on a Asus WL-HDD some time ago with SableVM. The WL-HDD can run Debian and connect some memory/hdd through USB. But performance was really bad.

like image 1
PeterMmm Avatar answered Nov 11 '22 08:11

PeterMmm


Use the Embeded JRE these days. http://www.oracle.com/technetwork/java/embedded/overview/index.html

It also exists for ARM and not only for Intel architecture platforms.

like image 1
feder Avatar answered Nov 11 '22 08:11

feder