Java

I would like to install Java on Yun and I think it' s possible. Which version should I use?
What problems am I likely to face during the installation ?

Install jamvm, it need 8MB space.

opkg update
opkg install jamvm

You might need Rootfs on External Storage

http://forum.arduino.cc/index.php?topic=204642.msg1506940#msg1506940

I've installed jamvm, now I try to understand if jam work correctly.

I've used this option

OPKG Package Manager [Old OpenWrt Wiki]
opkg install somepackage -d destination_name
The dest argument must refer to one of the defined destinations in /etc/opkg.conf

Thanks a lot

I stored the following one-liner 'java' script in the same directory where the jamvm executable file is stored:

exec jamvm -Xbootclasspath:/opt/usr/share/jamvm/classes.zip:/opt/usr/share/classpath/glibj.zip $1 $2 $3 $4 $5 $6 $7 $8 $9

the path /opt is a symbolic link to /mnt/sda1/opt where the entire shebang is stored on my sd card. As a convenience this allows my to do: 'java MyClass', without that horrible command line needed for jamvm.

kind regards,

Jos

Have someone compiled the openJdk ?

Can the Java Embedded of Oracle work on Yun ? I've had problems when I launch the command java

OpenJDK is not available for the MIPS processor; b.t.w. what were the problems you experienced with that small script?

kind regards,

Jos

I've try the embedded Java of

when I launch java command, the output is:

ejre1.7.0_51/bin/java: line 1: syntax error: unexpected word (expecting ")")

I've create

ln -s /opt/repo/usr/share/classpath/ /usr/share/classpath
ln -s /opt/repo/usr/share/jamvm/ /usr/share/jamvm
ln -s /opt/repo/usr/lib/classpath /usr/lib/classpath

obtained from
/opt/repo/usr/bin/jamvm -version

jamvm seem work correctly

Now my problem is use Log4j. I've the message "... Caused by: java.lang.OutOfMemoryError"

Jamvm tries to claim a small fraction of all available memory; the OpenWRT OS doesn't have much memory, so jamvm claims too little memory; add the flag -Xmx32M to the command line to help jamvm a bit ...

kind regards,

Jos

ps. why did you add all those symbolic links? Just the single link /opt --> /mnt/sda1/opt is enough and two lines changed in /etc/profile:

export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/usr/bin
export LD_LIBRARY_PATH=/opt/usr/lib:/opt/usr/lib/classpath

When I've installe jamvm I've changed path to repo (a path set in /etc/opkg.conf ) so jamvm -version write

Boot Library Path: /usr/lib/classpath
Boot Class Path: /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip

but they don't exist.

Those are the default paths; if you have installed the jamvm stuff on an sd, those defaults are not valid indeed; that's what my little 'java' script takes care of ...

kind regards,

Jos