bugGNU Octave - Bugs: bug #52617, configure finds java-9 too old

 
 

bug #52617: configure finds java-9 too old

Submitter:  Dmitri A. Sergatskov <dasergatskov>
Submitted:  Thu 07 Dec 2017 09:45:12 PM UTC
   
 
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 08 Dec 2017 05:49:00 AM UTC, comment #6: 

I checked in the fix on stable and also pulled across to the development branch.  Marking as fixed and closing report.

Rik <rik5>
Group administrator
Fri 08 Dec 2017 01:09:20 AM UTC, comment #5: 

There already is bug #51804.

Mike Miller <mtmiller>
Group Member
Fri 08 Dec 2017 12:54:04 AM UTC, comment #4: 

That worked. The failing java test is

octave:1> test ov-java.cc-tst
*** testif HAVE_JAVA; usejava ("jvm")
 n = javaObject ("java.lang.Integer", 1.35);
 assert (n.compareTo (0), 1);
 assert (n.compareTo (1), 0);
 assert (n.compareTo (2), -1);
!!!!! test failed
[java] java.lang.ClassCastException: java.base/java.lang.Double cannot be cast to java.base/java.lang.Integer
octave:2>

May be it deserves its own bug report...

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 07 Dec 2017 11:36:41 PM UTC, comment #3: 

Try the attached java9.diff patch.


patch -p1 < java9.diff
rm config.cache   # if you use it
./bootstrap
./configure



Rik <rik5>
Group administrator
Thu 07 Dec 2017 10:52:11 PM UTC, comment #2: 

checking whether the arpack library is free of bugs... yes
checking for java... /usr/lib/jvm/java-9/bin/java
checking for javac... /usr/lib/jvm/java-9/bin/javac
checking for jar... /usr/lib/jvm/java-9/bin/jar
checking for Java version... 9.0.1
configure: WARNING: Java version is too old (< 1.5).  Octave will not be able to call Java methods.

Java in the path is different, so jave -version is
openjdk version "1.8.0_151"

I was able to build with Java 9 (which resulted in some test failures, but otherwise was OK); now I cannot.
There were some java-9 updates since then, so it might be not
related to changes in octave source.

Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Thu 07 Dec 2017 10:35:30 PM UTC, comment #1: 

The code that checks version numbers in configure.ac is

  ## Check Java version is recent enough.
  AC_MSG_CHECKING([for Java version])
  java_version=[`"$JAVA" -version 2>&1 | $SED -n -e 's/^[^ ]* version[^0-9"]*"\([^"]*\)"/\1/p'`]
  AC_MSG_RESULT([$java_version])
  java_major=[`echo $java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\1/'`]
  java_minor=[`echo $java_version | $SED -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\..*$/\2/'`]
  if test $java_major -ge 1 && test $java_minor -ge 5; then
    :  # Version is ok.  Do nothing.
  else
    warn_java="Java version is too old (< 1.5).  Octave will not be able to call Java methods."
    break
  fi


In config.log, do you have "checking for Java version"?  An extract of my config.log is shown below.


configure:74954: result: /usr/lib/jvm/java-8-openjdk-amd64/bin/jar
configure:74969: checking for Java version
configure:74972: result: 1.8.0_151
configure:75023: checking for libjvm.so


Version is 1.8.X.  What does


java -version


on the command line return?

Rik <rik5>
Group administrator
Thu 07 Dec 2017 09:45:12 PM UTC, original submission:  

Running configure with JAVA_HOME="/usr/lib/jvm/java-9
(or directly with /usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64)
results in:


configure: WARNING: Java version is too old (< 1.5).  Octave will not be able to call Java methods.


I see in config.log:


config.log:configure:74763: checking for java
config.log:configure:74781: found /usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/java
config.log:configure:74793: result: /usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/java
config.log:configure:74835: checking for javac
config.log:configure:74853: found /usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/javac
config.log:configure:74865: result: /usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/javac
config.log:configure:74893: found /usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/jar
config.log:configure:74905: result: /usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/jar
config.log:  Java home:                     /usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64
config.log:ac_cv_env_JAVA_HOME_value=/usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64
config.log:ac_cv_path_JAR=/usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/jar
config.log:ac_cv_path_JAVA=/usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/java
config.log:ac_cv_path_JAVAC=/usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/javac
config.log:JAR='/usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/jar'
config.log:JAVA='/usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/java'
config.log:JAVAC='/usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64/bin/javac'
config.log:JAVA_HOME='/usr/lib/jvm/java-9-openjdk-9.0.1.11-4.fc27.x86_64'


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #42602:  java9.diff added by rik5 (723B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by dasergatskov (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-12-08 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2017-12-07 rik5 Attached File- Added java9.diff, #42602
    2017-12-07 rik5 StatusNeed Info Patch Submitted
    2017-12-07 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code