re-set Java to launch IGV

104 views
Skip to first unread message

marongi...@gmail.com

unread,
Nov 12, 2018, 5:27:40 AM11/12/18
to igv-help
Dear all,
I installed Java 10 alongside openjfx-11 to launch IGV and it worked fine until last week when I used ANACONDA to install another program. Somehow the installation (either of Anaconda itself or of the selected program) must have messed with java because only java 10 was available and IGV did not run any more.
I reinstalled openjfx and now the alternative versions of java are:

$   sudo update-alternatives --config java
[sudo] password for gigiux: 
There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                        Priority   Status
------------------------------------------------------------
  0            /usr/lib/jvm/java-10-oracle/bin/java         1091      auto mode
  1            /usr/lib/jvm/java-10-oracle/bin/java         1091      manual mode
* 2            /usr/lib/jvm/java-8-openjdk-amd64/bin/java   2         manual mode
  3            /usr/lib/jvm/jdk-11.0.1/bin/java             1         manual mode

Press <enter> to keep the current choice[*], or type selection number: 0
update-alternatives: using /usr/lib/jvm/java-10-oracle/bin/java to provide /usr/bin/java (java) in auto mode
$ igv
Unrecognized option: --module-path=/home/gigiux/src/IGV/lib:/usr/share/java/openjfx-sdk-11/lib
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

You can see that I selected java 10 (option 0) but does not work even with the other options; igv is a soft link to igv.sh. The line to get openjfx in this files is:
exec java --module-path="$prefix"/lib:/usr/share/java/openjfx-sdk-11/lib \

How can I fix this problem and launch IGV again?

Thank you

James Robinson

unread,
Nov 12, 2018, 6:24:58 PM11/12/18
to igv-...@googlegroups.com
I can't answer your linux questions but which version of IGV are you running?  The released version will not run with Java 10, it requires Java 8.   There is a development "snapshot" version that will.

--

---
You received this message because you are subscribed to the Google Groups "igv-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to igv-help+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/d2938435-a3d4-4af3-9d90-5ba8f8cecd8e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luigi Marongiu

unread,
Nov 13, 2018, 3:12:40 AM11/13/18
to igv-...@googlegroups.com
It is indeed the snapshot version: I had a previous problem with the
new version of openjfx provided by Ubuntu 18 which was fixed by using
the snapshot. Now, thanks to anaconda, I have again a version issue.
The funny thing is that Java 10 was the only version available (looks
like anaconda erased openjfx or maybe it changed some log files) so I
don't know why IGV is no longer working. Maybe shall I change the java
--module-path line?
Thanks
> You received this message because you are subscribed to a topic in the Google Groups "igv-help" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/igv-help/6XPTZkk7bH0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to igv-help+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/CACOP%2BptGzZ0Cn3LOkCQdRMuMN%3D5vKs5CA5_WsP%2BnCNoxEXA7LA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Best regards,
Luigi

David Eby

unread,
Nov 13, 2018, 1:10:04 PM11/13/18
to igv-help
Hi Luigi,

Personally I find this "alternatives" mechanism not too reliable when it comes to platforms like Java (I guess Python and R would be similar).  It's too much of a classic UNIX approach where it's just concerned with "path to an executable" and doesn't account for things like environment variables, supporting library locations, or even multiple related executables (not just "java" but javac, jar, and so on).  

So, my guess is that this is actually launching with Java 8 despite your change to "alternatives".  That's consistent with the "--module-path" error since that's unrecognized in Java 8 but would be fine in Java 10 or 11.  You could test by modifying your script to output "java -version" instead of doing the launch.

I'm not quite sure why they make this the official way to change these settings.  Like I said, I find it unreliable.  My approach is to set JAVA_HOME and PATH appropriately instead.

You could do this in your account profile but it's probably better to just set it within the launcher script.  Then you don't need to worry about other programs changing things.

FWIW, this whole concern should go away soon.  We're already building a Java 11 branch snapshot that 1) contains no JavaFX or JAXB code; and 2) includes OpenJDK 11 along with the IGV bundle.  In particular, Java is moving in the direction of (2) for distribution so we're heading that way as well.

We haven't been advertising this yet (work in progress) but let us know if you are interested in trying it.

Regards,
David

Luigi Marongiu

unread,
Nov 14, 2018, 9:00:31 AM11/14/18
to igv-...@googlegroups.com
I would be more than happy to try the new snapshot, but I did not
understand how to launch java 10 with the one I have already. shall I
modify the line in igv.sh to point to my java 10 folder?
thanks
luigi
> To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/7e71abff-43f0-4539-ae7d-a734f227fdfb%40googlegroups.com.

David Eby

unread,
Nov 14, 2018, 2:22:12 PM11/14/18
to igv-help
Hi Luigi,

Yes, that's exactly what I meant; sorry for any confusion.  Try setting the JAVA_HOME and PATH variables within that script to point to your Java 10 installation.

Our experimental Java 11 bundles are (temporarily) in the scratch area of our Downloads area: http://data.broadinstitute.org/igv/projects/downloads/scratch/snapshot_java11/

We'll be moving them soon but there's no ETA on when we'll make that the official release.

Regards,
David

Luigi Marongiu

unread,
Nov 16, 2018, 8:33:41 AM11/16/18
to igv-...@googlegroups.com
Thank you,
I could not launch the snapshot 10 but I could launch the snapshot 11
you linked. I changed the line
@igv.args to @${prefix}/igv.args to launch igv.sh with a symbolic link
and it worked.
Case closed.
Regards,
Luigi
> To view this discussion on the web visit https://groups.google.com/d/msgid/igv-help/b0cd61ee-c63b-45d0-95ff-5dee981b20d2%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages