bioconda / bioconda-recipes

Conda recipes for the bioconda channel.
https://bioconda.github.io
MIT License
1.62k stars 3.24k forks source link

Building with oracle jdk (jfx ) #8540

Open lindenb opened 6 years ago

lindenb commented 6 years ago

Hi all, first time here.

I'm trying to write a recipe for my java-based package jvarkit. Some tools require the jfx package wich is not included in openjdk. That is why I've defined my yaml (https://github.com/lindenb/bioconda-recipes/blob/56cbb513248b5efa4f3656f6852495eb10308d38/recipes/jvarkit/2018.04.05/meta.yaml ) using java-jdk:

(...)
  build:
      - java-jdk >=8,<9
      - (...)
  run:
      - java-jdk >=8,<9
      - (...)
(...)
extra:
   skip-lints:
     - uses_javajdk

However, it seems that I still cannot compile my sources (javafx.scene.canvas does not exist while it's part of java8 ) as if the java compiler was not the oracle jdk.

https://circleci.com/gh/lindenb/bioconda-recipes/36

$javafx.scene.canvas does not exist
import javafx.scene.canvas.GraphicsContext;
                          ^
/opt/conda/conda-bld/jvarkit_1522955849324/work/jvarkit-2018.04.05/src/main/jav$
                        final GraphicsContext g,
                              ^
  symbol:   class GraphicsContext
  location: class Hershey
2 errors

what am i doing wrong ?

thanks .

apeltzer commented 6 years ago

I wonder whether it would not make sense to send a package request to conda-forge for the OpenJFX package. With this, it should be possible to just use the "regular" OpenJDK package from conda-forge and add the OpenJFX package as a dependency to it.

https://wiki.openjdk.java.net/display/OpenJFX/Building+OpenJFX

Its currently not available on conda, default nor here on bioconda - so I'll have a look and maybe send it to conda-forge then.

(when I install locally with OpenJDK, I need to install OpenJFX to get jvarkit and some of my own JavaFX applications to run, so this should solve the issues).

apeltzer commented 6 years ago

@johanneskoester Seems to be one of the authors of the OpenJDK recipe on conda-forge (https://github.com/conda-forge/openjdk-feedstock), maybe he'd be willing to add this ...

lindenb commented 6 years ago

so I'll have a look and maybe send it to conda-forge then.

thank you for this :+1:

lindenb commented 6 years ago

later, I've added

java -version
javac -version

in my build.sh https://github.com/lindenb/bioconda-recipes/blob/c22dc733cdcd41836ee432f7ac694074f1d0a67d/recipes/jvarkit/2018.04.05/build.sh#L9

this is the output of circleci https://circleci.com/gh/lindenb/bioconda-recipes/41


+ java -version
openjdk version "1.8.0_112"
OpenJDK Runtime Environment (Zulu 8.19.0.1-linux64) (build 1.8.0_112-b16)
OpenJDK 64-Bit Server VM (Zulu 8.19.0.1-linux64) (build 25.112-b16, mixed mode)
+ javac -version
javac 1.8.0_112

so it's still openjdk while I asked for java-sdk https://github.com/lindenb/bioconda-recipes/blob/c22dc733cdcd41836ee432f7ac694074f1d0a67d/recipes/jvarkit/2018.04.05/meta.yaml#L23

so I'm doing something wrong, or may be it's 'just' a bug in circleci ?

I don't currently have a machine to test this with docker.

apeltzer commented 6 years ago

It might as well be, that java-jdk is just providing any JDK, not necessarily the Oracle JDK. Also, Oracle JDK has some issues with licencing (Oracle Licence...), that forbid certain types of distribution etc, so that could also explain why there is just OpenJDK available here.

lindenb commented 6 years ago

so that could also explain why there is just OpenJDK available here.

' makes sense.

dpryan79 commented 6 years ago

java-jdk has been deprecated, that package has no contents (other than an info/ directory). C.f. https://github.com/bioconda/bioconda-recipes/commit/027d5345ce876e49e14a56b4b13991edd500a987

dpryan79 commented 6 years ago

I assume you can use version 8.0.92, though.

lindenb commented 6 years ago

I assume you can use version 8.0.92

@dpryan79 thank you devon, how can I configure this ?

otherwise, what I've done will be useless. My most interesting tools require some oracle-things, like the possibility to compile some java code in memory at runtime. I've just tested one of my tools with openjdk, it won't work:

/usr/lib/jvm/java-8-openjdk-i386/jre/bin/java -jar  dist/vcffilterjdk.jar -e 'return variant.getStart()%20==0;' input.vcf

java.lang.RuntimeException: ToolProvider.getSystemJavaCompiler() failed. Do you use a correct version of java ? Please check the version and avoid openJDK, use the java from Oracle.
    at com.github.lindenb.jvarkit.lang.InMemoryCompiler.compileClass(InMemoryCompiler.java:165)
    at com.github.lindenb.jvarkit.tools.vcffilterjs.VcfFilterJdk$CtxWriterFactory.initialize(VcfFilterJdk.java:619)
    at com.github.lindenb.jvarkit.tools.vcffilterjs.VcfFilterJdk.doWork(VcfFilterJdk.java:718)
    at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMain(Launcher.java:1208)
    at com.github.lindenb.jvarkit.util.jcommander.Launcher.instanceMainWithExit(Launcher.java:1366)
    at com.github.lindenb.jvarkit.tools.vcffilterjs.VcfFilterJdk.main(VcfFilterJdk.java:737)
dpryan79 commented 6 years ago

Try the following under build: and run:

- java-jdk ==8.0.92
lindenb commented 6 years ago

it didn't work: :-(

https://github.com/lindenb/bioconda-recipes/blob/06f2370bf825b316ff9b7f09a26dacc968271fe5/recipes/jvarkit/2018.04.05/meta.yaml#L23

circleci still uses openjdk

https://circleci.com/gh/lindenb/bioconda-recipes/45

thank you anyway

dpryan79 commented 6 years ago

Odd, the java-jdk tarball does in fact contain openjdk. I wonder if that was an error.

rvalieris commented 6 years ago

we never had a oracle jdk package, we just renamed the java-jdk to openjdk to make it clearer what it contains and transition it to conda-forge. as I understand, oracle jdk contains non-open-source stuff so I don't even know if we could re-distribute it through conda.