Java version not recognized (STRUCTURE installation)

695 views
Skip to first unread message

Valéria Marques

unread,
Mar 9, 2021, 3:16:17 PM3/9/21
to structure-software

I switched from Windows to Ubuntu early this year and I've encountered some difficulties but so far have been able to resolve them on my own, with trial and error and simple google searches.

This one I still wasn't able to solve: I'm trying to install STRUCTURE with frontend; I already installed Java, and running the command java -version I get this output: 

openjdk version "1.8.0_282"
OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~20.04-b08)
OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode)

Now, when I proceed to the installation it asks me for the path to Java, which I determined using the command readlink -f $(which java) to be /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java.

However, I then get the error:

/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java (version 1.) is not a compatible JRE

It seems that the version of Java is not recognized (?); maybe it is too new? Is there something I can do to solve this issue? I can run STRUCTURE without frontend but I would prefer to use the frontend since I my analyses have high numbers of K and a lot of iteractions.

Thank you so much in advance and I'm sorry if this post is confusing,

Valéria

Loris Capria

unread,
Mar 9, 2021, 3:38:14 PM3/9/21
to structure-software
Hi  Valéria,
I found myself in the same situation few weeks ago.
The only solution I could find was modifying the "install" file to avoid structure to stop the installation when java version do not correspond to what structure requests
In ./fontend open the install file with a text editor and delete from line 25 to line 40:


if($flag == 1){

   print STDERR "\nIf you do have compatible JRE in the system, specify the path to java\n";
   $jpath = <STDIN>;
   chomp $jpath;
   $out = `$jpath -version 2>&1`;
   if ( $out !~ /\w/ || $out=~/GNU/){
      print STDERR "Sorry, $jpath is not a compatible JRE\n";
      exit(1);
   }

   $out =~ /java version \"1\.(\d)\.*/;
   if($1<5){
      print STDERR "Sorry, $jpath (version 1\.$1) is not a compatible JRE \n";
      exit(1);
   }
   $flag = 0;
}

DELETE THE SCRIPT ABOVE
then save and proceed with installation.

For me worked perfectly after this change.
Hope it works for you as well.

Loris

Valéria Marques

unread,
Mar 9, 2021, 3:51:08 PM3/9/21
to structure-software

Hello Loris,

Thank you so much, your solution worked perfectly, the STRUCTURE frontend is now working as intended.

I was thinking of modifying the install file but was afraid it would not correctly install after I did that. 
In retrospect I could've just created a backup of the original and tried it, but well this way anyone who encounters the same problem can find the way to solve it.

Thank you again for the quick response.

Cheers,

Valéria
Reply all
Reply to author
Forward
0 new messages