bugGNU Octave - Bugs: bug #40111, Support runtime selection of Java...


bug #40111: Support runtime selection of Java version on Linux and Unix systems

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Thu 26 Sep 2013 01:07:40 PM UTC  
Category: Configuration and Build SystemSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Feature Request
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: devOperating 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.


Wed 17 Dec 2014 04:45:04 PM UTC, comment #4:

This bug is still present in Fedora 21: after an upgrade of JDK, the java lib cant't be found anymore, up to the next recompilation.

I enclose a small patch adding a fallback mechanism. If loading the jvm lib from the static path fails, try a dynamic path built from the environment variable JAVA_JVM_LIB.



(file #32686)

Pascal Dupuis <cdemills>
Mon 30 Sep 2013 06:01:24 PM UTC, comment #3:

The examples are meant to illustrate the logic for finding the jvm, not for copying into configure.ac.

Whether configure.ac is fine as it is?
Yes I'd agree with you, except maybe for Mac OSX; the examples contain some sections devoted to OSX as well.

Philip Nienhuis <philipnienhuis>
Project Member
Mon 30 Sep 2013 12:14:28 AM UTC, comment #2:

Your examples are all for configure scripting. I think Java detection in the configure script is fine as it is. This bug is about overriding the Java path at runtime by setting JAVA_HOME in the shell environment or in octaverc.

Mike Miller <mtmiller>
Project Member
Fri 27 Sep 2013 02:06:13 PM UTC, comment #1:

For the automatic way, here are some links (from this thread:



(From what I can see in Octave's configure.ac there's already quite a bit of these implemented.)

I haven't looked whether these configure macros also detect the JVM on 64 bit systemes (where they reside in
...rather than

(and my 'configure proficiency' is lacking anyway)

Philip Nienhuis <philipnienhuis>
Project Member
Thu 26 Sep 2013 01:07:40 PM UTC, original submission:

We currently hardcode the path to the Java runtime (specifically the libjvm.so library) in the Octave interpreter at compile-time. The library is not actually used at compile-time, since it is dlopen'd only when Octave needs it. It would be better if there was an ability for the user to override this path in the Octave interpreter at runtime.

The easiest and most obvious solution would be to keep the hardcoded path as it is now and allow the user's JAVA_HOME environment variable to override it.

More ambitious would be to do some kind of automatic determination of the Java path at runtime, but that's already hard enough as it is in the configure script.

Mike Miller <mtmiller>
Project Member


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

Attach File(s):

Attached Files
file #32686:  ov-java.pat added by cdemills (993B - application/octet-stream)


Depends on the following items: None found

   bug dependencies.


Carbon-Copy List
  • -unavailable- added by cdemills (Updated the item)
  • -unavailable- added by mtmiller (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 17 Dec 2014 04:45:03 PM UTCcdemillsAttached File-=>Added ov-java.pat, #32686
    Wed 11 Jun 2014 12:05:21 PM UTCmtmillerDependencies-=>bugs #42540 is dependent

    Back to the top

    Powered by Savane 3.1-cleanup