dnanexus-archive / viral-ngs

viral-ngs
6 stars 6 forks source link

Dynamic assignment of java version #34

Closed yifei-men closed 7 years ago

yifei-men commented 7 years ago

33 Updates java to java8 for all java-requiring applets in the viral-ngs repo.

However, we know that GATK is quite finicky with Java versioning (3.6 onwards require Java8, but those below 3.6 have incomplete support for java8).

Initial tests suggest that the java8 does not break existing modules in earlier versions of GATK, but we should not rely on this being true.

Ideally, we would want to be able to dynamically set the java version, since GATK jar file is user-provided and versioning cannot be enforced.

We could use something along the lines of

# Use java7 as the default java version. 
# If java7 doesn't work with the GATK version (3.6 and above) then switch to java8 and try again.

update-alternatives --set java /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
java -jar GenomeAnalysisTK.jar -version || (update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java && java -jar GenomeAnalysisTK.jar -version)

to dynamically assign java default version.

yifei-men commented 7 years ago

@tomkinsc is this now addressed natively by the Conda packaging / easy-deploy activation of the conda environment?

tomkinsc commented 7 years ago

It should be, yes!

yifei-men commented 7 years ago

Closed as this is now addressed by upstream easy-deploy script / Conda packaging.