bugGNU Octave - Bugs: bug #38593, detection of java version fails on...

 
 

bug #38593: detection of java version fails on NixOS

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Tue 26 Mar 2013 04:20:58 AM UTC  
 
Category: Configuration and Build SystemSeverity: 3 - Normal
Priority: 2Item Group: Build Failure
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 26 Mar 2013 04:48:59 PM UTC, comment #5:

Although it's not perfect, I like that the sed method is quick and simple to understand. I checked in a changeset which looks for just the keyword version (http://hg.savannah.gnu.org/hgweb/octave/rev/effe80808118). It should solve the problem. If we get more weirdness we can look at re-structuring to do the testing from within Java itself.

Rik <rik5>
Project Administrator
Tue 26 Mar 2013 04:19:58 PM UTC, comment #4:

Totally agree.

I think this might be better handled in the OctJavaQry class, using the standard system property "java.version" instead of trying to parse the interpreter output with sed, sound good?

I can fix this a little later today, no need to do this unless you really want to.

As posted in the original report, here's the complete output:

Mike Miller <mtmiller>
Project Administrator
Tue 26 Mar 2013 03:54:22 PM UTC, comment #3:

The lack of standardization for a supposedly cross-platform tool is really tiresome.

So what does the shell command return in its entirety?

We could possibly change the regular expression to look for just 'version "XXX.XXX.XXX"' instead. That would only work provided that no other line in the output would match.

When I run the above I get

So it would at least work for older versions of OpenJDK in an Ubuntu environment.

Rik <rik5>
Project Administrator
Tue 26 Mar 2013 03:20:58 PM UTC, comment #2:

No, the problem is not with the installation location. It does find a valid JDK using PATH. The problem is the version check that is done regardless of specifying JAVA_HOME or not:

http://hg.savannah.gnu.org/hgweb/octave/file/7ce21619a4b9/configure.ac#l2386

The current check requires a line to start with "java version" but I'm seeing "openjdk version" on NixOS for some reason. I have never seen this variant before, but apparently there is a way to configure OpenJDK to identify itself this way.

Mike Miller <mtmiller>
Project Administrator
Tue 26 Mar 2013 03:09:02 PM UTC, comment #1:

This is really a problem with Java and the fact that no standard developed for the installation location across various operating systems. The recommended solution is to set the JAVA_HOME environment variable to point to the JDK (not JRE) installation location.

Rik <rik5>
Project Administrator
Tue 26 Mar 2013 04:20:58 AM UTC, original submission:

Detection of Java on NixOS fails with the following configure output (excerpted from http://hydra.nixos.org/build/4480504/log/raw):

Here is the output of "java -version" on Debian GNU/Linux:

And here is "java -version" on NixOS:

Mike Miller <mtmiller>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 26 Mar 2013 04:48:59 PM UTCrik5StatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Tue 26 Mar 2013 03:09:02 PM UTCrik5Priority5 - Normal=>2

    Back to the top


    Powered by Savane 3.1-cleanup1