usadellab / Trimmomatic

Other
217 stars 70 forks source link

Build issue with JAVA Version #35

Open bevsxyz opened 2 years ago

bevsxyz commented 2 years ago

I think the source and target version for compile target should be bumped to at least 1.6 (the best choice would be 1.8 corresponding to openjdk-8) for compatibility with openjdk-8.

I had also set an additional variable bootclasspath="/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar" in a Ubuntu 20.04 machine with openjdk-8 installed to solve the bootstrap class path not set in conjunction with -source x warning, but that's not required for compiling.

The current java version specified in the build XML file is quite old and unsupported. Newer compilers do not support it and simply running ant doesn't work.

https://github.com/usadellab/Trimmomatic/blob/93c7b1207eb7c9c72447a6bf2f1342878946c754/build.xml#L34

Build Errors

I have tried with openjdk-17, which gives me the following error for the compile target

compile:
    [javac] Compiling 65 source files to /home/bevan/Trimmomatic/dist/build
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 5
    [javac] error: Source option 5 is no longer supported. Use 7 or later.
    [javac] error: Target option 5 is no longer supported. Use 7 or later.

BUILD FAILED
/home/bevan/Trimmomatic/build.xml:34: Compile failed; see the compiler error output for details.

With openjdk-8 and openjdk-11 the error is

compile:
    [javac] Compiling 65 source files to /home/bevan/Trimmomatic/dist/build
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 5
    [javac] error: Source option 5 is no longer supported. Use 6 or later.
    [javac] error: Target option 1.5 is no longer supported. Use 1.6 or later.

BUILD FAILED
/home/bevan/Trimmomatic/build.xml:34: Compile failed; see the compiler error output for details.

Version 1.8

Setting source and target to 1.8 in the following line, gives

https://github.com/usadellab/Trimmomatic/blob/93c7b1207eb7c9c72447a6bf2f1342878946c754/build.xml#L34

openjdk-17

compile:
    [javac] Compiling 65 source files to /home/bevan/Trimmomatic/dist/build
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 8
    [javac] /home/bevan/Trimmomatic/src/org/usadellab/trimmomatic/trim/BaseCountTrimmer.java:30: warning: [removal] Integer(String) in Integer has been deprecated and marked for removal
    [javac]                 maxCount=new Integer(split[2]);
    [javac]                          ^
    [javac] 2 warnings

dist:
    [unjar] Expanding: /home/bevan/Trimmomatic/dist/lib/jbzip2-0.9.1.jar into /home/bevan/projects/git/Trimmomatic/dist/unpack
   [delete] Deleting directory /home/bevan/Trimmomatic/dist/unpack/META-INF
   [delete] Deleting directory /home/bevan/Trimmomatic/dist/unpack/demo
     [move] Moving 1 file to /home/bevan/Trimmomatic/dist/unpack
     [move] Moving 1 file to /home/bevan/Trimmomatic/dist/unpack
     [copy] Copying 80 files to /home/bevan/Trimmomatic/dist/unpack
      [jar] Building jar: /home/bevan/Trimmomatic/dist/jar/trimmomatic-0.40-rc1.jar
      [zip] Building zip: /home/bevan/Trimmomatic/dist/Trimmomatic-0.40-rc1.zip
      [zip] Building zip: /home/bevan/Trimmomatic/dist/Trimmomatic-Src-0.40-rc1.zip

BUILD SUCCESSFUL
Total time: 6 seconds

openjdk-11

compile:
    [javac] Compiling 65 source files to /home/bevan/Trimmomatic/dist/build
    [javac] warning: [options] bootstrap class path not set in conjunction with -source 8
    [javac] Note: /home/bevan/Trimmomatic/src/org/usadellab/trimmomatic/trim/BaseCountTrimmer.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 1 warning

dist:
    [unjar] Expanding: /home/bevan/Trimmomatic/dist/lib/jbzip2-0.9.1.jar into /home/bevan/Applications/Trimmomatic/dist/unpack
   [delete] Deleting directory /home/bevan/Trimmomatic/dist/unpack/META-INF
   [delete] Deleting directory /home/bevan/Trimmomatic/dist/unpack/demo
     [move] Moving 1 file to /home/bevan/Trimmomatic/dist/unpack
     [move] Moving 1 file to /home/bevan/Trimmomatic/dist/unpack
     [copy] Copying 80 files to /home/bevan/Trimmomatic/dist/unpack
      [jar] Building jar: /home/bevan/Trimmomatic/dist/jar/trimmomatic-0.40-rc1.jar
      [zip] Building zip: /home/bevan/Trimmomatic/dist/Trimmomatic-0.40-rc1.zip
      [zip] Building zip: /home/bevan/Trimmomatic/dist/Trimmomatic-Src-0.40-rc1.zip

BUILD SUCCESSFUL
Total time: 0 seconds

openjdk-8

compile:
    [javac] Compiling 65 source files to /home/bevan/Trimmomatic/dist/build
    [javac] Note: /home/bevan/Trimmomatic/src/org/usadellab/trimmomatic/trim/BaseCountTrimmer.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.

dist:
    [unjar] Expanding: /home/bevan/Trimmomatic/dist/lib/jbzip2-0.9.1.jar into /home/bevan/Applications/Trimmomatic/dist/unpack
   [delete] Deleting directory /home/bevan/Trimmomatic/dist/unpack/META-INF
   [delete] Deleting directory /home/bevan/Trimmomatic/dist/unpack/demo
     [move] Moving 1 file to /home/bevan/Trimmomatic/dist/unpack
     [move] Moving 1 file to /home/bevan/Trimmomatic/dist/unpack
     [copy] Copying 78 files to /home/bevan/Trimmomatic/dist/unpack
      [jar] Building jar: /home/bevan/Trimmomatic/dist/jar/trimmomatic-0.40-rc1.jar
      [zip] Building zip: /home/bevan/Trimmomatic/dist/Trimmomatic-0.40-rc1.zip
      [zip] Building zip: /home/bevan/Trimmomatic/dist/Trimmomatic-Src-0.40-rc1.zip

BUILD SUCCESSFUL
Total time: 0 seconds
bevsxyz commented 2 years ago

https://github.com/usadellab/Trimmomatic/issues/24#issue-1147486679 already reported the problem before I did. I should have checked the issues before troubleshooting on my own 😆