bugGNU Octave - Bugs: bug #39065, libjvm detection on 64 bit systems...


bug #39065: libjvm detection on 64 bit systems for java package

Submitted by:  Fabio <efferre79>
Submitted on:  Fri May 24 22:07:47 2013  
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.6.4Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Wed Jan 15 22:08:11 2014, comment #11:

Chris, if you have a reason to reopen this bug, then proceed.

But for help and discussion, please use -unavailable- instead.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Wed Jan 15 21:42:12 2014, comment #10:

Hey I'm relatively new to both octave and linux but I have installed Ubuntu 12.04 and Octave 3.6.4. I'm trying to configure the java package to run properly but can't seem to set it up right. I followed the wiki guide and gotten everything up to this point of coming to this page. If anyone can help me set the rest of this up that'd be great. I've looked at the files on this page but I'm not sure what to do with them. If anyone has any suggestions on how to get the java package for octave to work I'm all ears.

Chris Lucas <lukie46>
Thu May 30 16:21:56 2013, comment #9:

updated the wiki pointing to this bug report.

Fabio <efferre79>
Wed May 29 19:36:01 2013, comment #8:

Sure, I respect your POV as well. I even sympathize with it - to some extent.

Maybe it helps to outline how the developers generally tend to think about situations like this:
How many users would actually benefit from a fix for a (in this case even vanished) package, vs. how many other useful things can developers do for many many more other users in the same time?

I suppose the next stable release will contain Java support. It may not work completely perfectly (but the Java package didn't either, yet in other ways) but it will be much more ML compatible.
Whether the latter is a real advantage is subject to perception, of course.

Once again I'd suggest to post your findings & suggestions for the fixes on the wiki.

Philip Nienhuis <philipnienhuis>
Project Member
Tue May 28 20:42:31 2013, comment #7:

Philip, sure I have already fixed the package on my system. What will happen with the new stable release of octave? Will the java package be made unavailable?

I respect your decision but I don't share it. My idea is that this is not a custom mod but an improvement in the usage of the package. The problem is general and is affecting many other users. The fix would be one time & place operation and it doesn't make much sense to me to reiterate the same patching on each system.

Fabio <efferre79>
Tue May 28 20:02:35 2013, comment #6:

Thanks Michael.

@Fabio: the beauty of open source is that you can fix anything you want for yourself, including the Java package. So why don't you just do that?
FWIW, my own Octave's installations usually contain several personal mods.

If you want to help other users you can add a description of your fixes (+ patches) to the wiki - it has a section about the Java package.

FYI Octave's lead dev has expressed his desire to make a new stable release (3.8 or maybe even 4.0) by the end of June. We'll see but it'll be close enough anyway.

Status set to "Won't fix" & closing

Philip Nienhuis <philipnienhuis>
Project Member
Tue May 28 14:21:41 2013, comment #5:

Making a new release of the java package is not a priority, as it's been integrated into octave. Moreover, it may reveal a bit tricky as the package sources have been removed from the octave-forge SVN repository.

Michael Goffioul <goffioul>
Project Member
Mon May 27 22:28:29 2013, comment #4:

The code in preinstall.m searching for jvm.cfg is reached on my Linux system with jdk_ok = false (without the patch), this happens because the ../client/ dir is not present. With the patch, the ../server/ dir is also evaluated as an alternative place where to find libjvm.so.

From what I understand (but I have not tested) the java package is only needed for octave 3.6.x. The next 3.7 octave release should have embedded the java functionality.

Nevertheless it will take some time before the 3.7 release becomes spread (is there any schedule?). In the meantime it'd be good, IMHO, to have a new java package release but I don't know how much effort is needed for a new release. Of course I'm in favour of a new release :-)

Fabio <efferre79>
Sun May 26 20:46:44 2013, comment #3:

"fixed" - a package with your suggested fix. You've done so, good & thanks.

The code in preinstall.m searching for jvm.cfg is meant to be reached only on Windows systems - actually its sole use is to check that JAVA_HOME was set correctly. That piece of code shouldn't be reached on Linux. Did you check that?
(I'm sorry I'm running out of time for Octave in the next 2-3 weeks so I'm not gonna do much about this now)

If -as you say- the libjvm.so (jvm.dll) location is already fixed in the development sources of Octave I expect little enthusiasm for a new Java pkg release.

If you insist on an updated OF Java package you'd have to deal with the maintainer (Michael Goffioul). If he agrees he'll probably delegate it anyway.

Philip Nienhuis <philipnienhuis>
Project Member
Sat May 25 20:34:03 2013, comment #2:

What do you mean with "fixed"? I have tested the patch on my linux 32 and 64-bit systems where the java package is compiled from source and then installed. It works correctly, I'll upload also the installation log. Then, with the patched package installed, the java functionality in octave-3.6.4 works without problems.

I have just read the contents of the pre_install.m file and it contains an imperfection (as is without the ../server/ detection). In fact on my system, where the .../client/ dir is not present, the pre_install.m function completes successfully because the jvm.cfg file is also present. So the user is not warned about a missing libjvm.so library, _java_.oct needs it but looks for it in the wrong location and the java functionality doesn't work out of the box. The library is indeed present below .../server/ but the pre_install.m script should detect it correctly. I'm attaching a patch to include also the ../server/ detection.

I have not tested octave-3.7.x yet but I have looked in the repository reading the configure.ac file and the new --with-java-libdir option. It looks also for the ../server/ alternative.

IMHO the symlink you suggest is something that can be avoided in the software because we already know in advance that 64-bit installations don't come with a ../client/ dir. The proposed patch broadens the userbase of the java package, I mean where it works flawlessly.

(file #28175, file #28176)

Fabio <efferre79>
Sat May 25 15:11:55 2013, comment #1:

Have you tried this patch in a "fixed" Java package, including installation?

AFAIK the following happens during Java pkg installation:

Already during install (rather: configure) time the JVM needs to be found. _java_.cc will be compiled into _java_.oct and isn't available during configure & first stages of installation. So this patch doesn't help at that stage.

I've added a file preinstall.m to the 1.2.9 Java package to help users find & set all prerequisites for installation of the Java package. This file preinstall.m will also have to be patched to detect the JVM in the .../server directory.

All this patching (+ a new java pkg release) can just be avoided by adding a simple symlink in ..../client pointing to .../server/libjvm.so, as outlined on the wiki.
Your patch would only help those users that aren't allowed (because of e.g., system policies) to add this symlink.

In core octave there's already a configure flag for setting the JVM location (but I don't know if it has ever been tested - I've got no 64-bit Linux yet).

All in all I wonder if patching the Java package + releasing a new one is really worth the trouble.

Philip Nienhuis <philipnienhuis>
Project Member
Fri May 24 22:07:47 2013, original submission:

On Linux 64 bit system the libjvm.so library is installed only below $JAVA_HOME/jre/lib/$JAVA_ARCH/server/libjvm.so and there is no similar library under the .../client/libjvm.so path. I have crosschecked a similar result with these two Java implementations:

1) oracle JDK
2) icedtea

I purpose to apply to the java package the simple patch here attached. Basically the libjvm.so will be chosen from the .../client/ path, the .../server/ is just a backup.

I know that next octave release is coming with Java but it will take some time before the new release is marked stable and available to the users that don't compile from source.

Fabio <efferre79>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #31103:  java-1.2.9.tar.gz added by None (1MB - application/x-gzip)
file #31104:  pre_install.m.patch added by None (2kB - text/x-patch)
file #31105:  g-octave:java-1.2.9:20130524-215204.log.gz added by None (3kB - application/x-gzip)
file #31106:  libjvm-detection.patch added by None (570B - text/x-patch)
file #28176:  pre_install.m.patch added by efferre79 (2kB - text/x-patch)
file #28162:  libjvm-detection.patch added by efferre79 (570B - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by lukie46 (Posted a comment)
  • -unavailable- added by goffioul (Posted a comment)
  • -unavailable- added by efferre79 (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Apr 2 17:29:55 2014NoneAttached File-=>Added java-1.2.9.tar.gz, #31103
      Attached File-=>Added pre_install.m.patch, #31104
      Attached File-=>Added g-octave:java-1.2.9:20130524-215204.log.gz, #31105
      Attached File-=>Added libjvm-detection.patch, #31106
    Tue May 28 20:02:35 2013philipnienhuisStatusNone=>Wont Fix
    Sat May 25 20:34:03 2013efferre79Attached File-=>Added g-octave:java-1.2.9:20130524-215204.log.gz, #28175
      Attached File-=>Added pre_install.m.patch, #28176
    Fri May 24 22:07:47 2013efferre79Attached File-=>Added libjvm-detection.patch, #28162

    Back to the top

    Powered by Savane 3.1-cleanup