Go Down

Topic: Java (Read 3319 times) previous topic - next topic

alfonso12

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 ?

sonnyyu

Install jamvm,  it need 8MB space.

Code: [Select]
opkg update
opkg install jamvm


You might need Rootfs on External Storage

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

alfonso12

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

I've  used this option

http://wiki.openwrt.org/doc/techref/opkg#installation.destinations

opkg install somepackage -d destination_name

The dest argument must refer to one of the defined destinations in /etc/opkg.conf


Thanks a lot

JosAH

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

alfonso12

#4
Feb 26, 2014, 04:51 pm Last Edit: Feb 26, 2014, 05:22 pm by alfonso12 Reason: 1
Have someone compiled the openJdk ?

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

JosAH

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

kind regards,

Jos

alfonso12

I've try the embedded Java of

http://www.oracle.com/technetwork/java/embedded/downloads/javase/index.html

when I launch java command, the output is:

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

alfonso12

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"

JosAH

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

alfonso12

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.

JosAH

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

Go Up