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.

 

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

Wed 04 Feb 2015 06:23:45 AM UTC, comment #7:

What about revising Pascal's patch in comment #4 to use the JAVA_HOME varibale?

Rik <rik5>
Project Administrator
Wed 04 Feb 2015 03:08:53 AM UTC, comment #6:

Hi Pascal, that is certainly one workaround for this problem, but ultimately I think we'd want to dynamically find the libjvm.so, and preferably using the semi-standardized JAVA_HOME environment variable.

On Debian we build with the path /usr/lib/jvm/default-java, for example

This makes it work with whatever the distro selects as the default Java, or in your case, the current version of Java 8, but it doesn't let a user pick a different Java runtime, for whatever reason they may need to do so.

Mike Miller <mtmiller>
Project Member
Tue 03 Feb 2015 05:22:27 PM UTC, comment #5:

I compiled octave-3.8.2 on Fedora 21 x86_64. I think I solved the Java issue by not using the full path name of libjvm.so, but a link which will stay constant but be upgraded to the right location with java update.

The technique is to use (under Fedora):

./configure --with-java-includedir=/usr/lib/jvm/java-1.8.0-openjdk/include --with-java-libdir=/usr/lib/jvm/java-1.8.0-openjdk/jre/lib/amd64/server (other options ...)

Regards

Pascal

Pascal Dupuis <cdemills>
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.

Regards

Pascal

(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:
http://lists.debian.org/debian-java/2009/04/msg00005.html):

http://gitweb.scilab.org/?p=scilab;a=blob;f=scilab/m4/java.m4;h=ace058ee88c6c9a876e22162bf4e62f5a6c2107c;hb=HEAD

http://gitweb.scilab.org/?p=scilab;a=blob;f=scilab/bin/scilab;h=65fd00adf4e1e38eeb2359f97e10bdb0a5c5ad41;hb=HEAD

(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
$JAVA_HOME/jre/lib/<arch>/server
...rather than
$JAVA_HOME/jre/lib/<arch>/client)

(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):
   
   
Comment:
   

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

 

Depends on the following items: None found

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -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