DanielBarker
Posts: 72
Joined: Tue May 29, 2012 7:53 am

Java confusion

Wed Oct 03, 2012 2:01 pm

Dear all,

Currently, which are the recommended packages to install, to run Java programs on Raspbian? default-jre, openjdk7-jre, etc?

I apologize for the basic question. I became confused with the various packages.

I don't want to do any development and I don't mind if it's slow.

But I do want to use Java programs, i.e. I require a functioning 'java' executable and whatever usually comes with it.

Most urgently I want to be able to run Modelgenerator <http://bioinf.nuim.ie/modelgenerator/>, a non-GUI program heavy on floating point, which is typically launched thus:

java -jar modelgenerator.jar options

There are also a few GUI programs I would be interested in running e.g. Mesquite <http://mesquiteproject.org/mesquite/mesquite.html>, for which a generic Unix version is available that requires Java.

Thank you very much, in advance.

Best regards,

Daniel Barker

plugwash
Forum Moderator
Forum Moderator
Posts: 3311
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java confusion

Wed Oct 03, 2012 4:44 pm

I would reccomend instaling openjdk-7-jre and icedtea7-jre-jamvm

Note that the default vm is "zero" which has good compatibility but is slow. To use jamvm (faster but lacks support for some advanced reflection features) use the -jamvm switch when running java (e.g "java -jamvm -jar modelgenerator.jar options" )

Cloudcentric
Posts: 982
Joined: Fri Sep 14, 2012 9:13 am

Re: Java confusion

Wed Oct 03, 2012 5:50 pm

Yep IcedTea 7 http://icedtea.classpath.org/wiki/Main_Page available via apt-get
I know everything about nothing"

User avatar
xranby
Posts: 538
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java confusion

Wed Oct 03, 2012 8:29 pm

plugwash wrote:I would reccomend instaling openjdk-7-jre and icedtea7-jre-jamvm

To use jamvm (faster but lacks support for some advanced reflection features)
@plugwash Please provide a testcase that demonstate any missing JVM reflection features if you make this claim, JamVM run daily jtreg testing, by the IcedTea team, and pass all the OpenJDK Hotspot reflection tests with no known reflection failures.

To use jamvm by default edit /etc/java-7-openjdk/jvm-armhf.cfg
and add
-jamvm KNOWN
at the top of the list.

JamVM is highly recommended.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

plugwash
Forum Moderator
Forum Moderator
Posts: 3311
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java confusion

Thu Oct 04, 2012 12:41 am

In that statement I was refferering to the following comment from jan77 (in the java on raspbian thread)
jan77 wrote: jamVM has some restrictions at low level platforms. Agents AND class proxies (used for various testing frameworks such as TestNG, JUnit etc.) won't work. But that's documented.
All the "standard" reflections work fine.
Do "agents and class proxies" not count as part of relfection? or do they now work in jamvm?

Note: I am one of the main guys behind raspbian and I know a bit about java but I would NOT call myself a java expert.

User avatar
xranby
Posts: 538
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java confusion

Thu Oct 04, 2012 8:07 am

plugwash wrote:In that statement I was refferering to the following comment from jan77 (in the java on raspbian thread)
jan77 wrote: jamVM has some restrictions at low level platforms. Agents AND class proxies (used for various testing frameworks such as TestNG, JUnit etc.) won't work. But that's documented.
All the "standard" reflections work fine.
Do "agents and class proxies" not count as part of relfection?
"agents" is part of the JVMTI tooling interface
http://docs.oracle.com/javase/7/docs/te ... des/jvmti/
and is used to attach "agent" debuggers and JVM monitors. This is not supported by JamVM.
A good way to solve this limitation is by configure your Java IDE to run "debug" sessions using Zero by passing, java -server , to allow code stepping, and to run non-debug fast "run" sessions using JamVM java -jamvm !

"proxies" is part of reflection and is covered by the Reflection API
http://docs.oracle.com/javase/7/docs/ap ... mmary.html
http://docs.oracle.com/javase/tutorial/ ... index.html
Below is extracts from JamVM JTreg unit testing results performed by the IcedTea buildbots:
Passed: java/lang/reflect/Proxy/nonJavaNames/Test.java
Passed: java/lang/reflect/Proxy/returnTypes/Test.java
Passed: java/lang/reflect/Proxy/Basic1.java
Passed: java/lang/reflect/Proxy/Boxing.java
Passed: java/lang/reflect/Proxy/CharType.java
Passed: java/lang/reflect/Proxy/ClassRestrictions.java
Passed: java/lang/reflect/Proxy/NullClassLoader.java
Thus reflect/Proxy is by our knowledge fully supported by JamVM.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

DanielBarker
Posts: 72
Joined: Tue May 29, 2012 7:53 am

Re: Java confusion

Wed Oct 31, 2012 9:33 am

Thank you all very much.

openjdk-7-jre worked fine. It is very slow, but OK. A quick test suggested jamvm didn't make much difference to speed with this particular application (Modelgenerator).

I found that openjdk-7-jre can also run Mesquite. This is very slow to start but OK once it does. (I didn't compare performance with jamvm here.)

Daniel Barker

Return to “Raspbian”