lindenb / jvarkit

Java utilities for Bioinformatics
https://jvarkit.readthedocs.io/
Other
486 stars 133 forks source link

class not found #116

Open bgphd opened 6 years ago

bgphd commented 6 years ago

Verify

compiled jvarkit in /usr/local/jvarkit on Mac High Sierra used export JAVA_HOME=/usr/libexec/java_home -v 1.8 successfully

Subject of the issue

invoke bamstats05 and get: Error: Could not find or load main class com.github.lindenb.jvarkit.tools.bamstats04.BamStats05 tried both make bamstats05 and make bamstats05 standalone=yes with the same result

Your environment

first two lines of filelist.txt directly below: USE160024-A1_L1_1.fq_USE160024-A1_L1_2.fq.sorted.deduped.bam USE160024-A1_L2_1.fq_USE160024-A1_L2_2.fq.sorted.deduped.bam

!/bin/bash

cd /Volumes/Promise\ RAID/novogene/deduped

export JAVA_HOME=/usr/libexec/java_home -v 1.8

IFS=$'\n' read -d '' -r -a file < filelist.txt

for i in seq 0 1 50; do

java -jar /usr/local/jvarkit/dist/bamstats05.jar -B /Users/bgold/Documents/reference/clinvar_20181028.bed "${file[i]}" > "${file[i]}".bamstats05.txt

join AllNov12bamstats05.txt "${file[i]}".bamstats05.txt

done

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead Error: Could not find or load main class com.github.lindenb.jvarkit.tools.bamstats04.BamStats05 Error: Could not find or load main class com.github.lindenb.jvarkit.tools.bamstats04.BamStats05 Error: Could not find or load main class com.github.lindenb.jvarkit.tools.bamstats04.BamStats05 Error: Could not find or load main class com.github.lindenb.jvarkit.tools.bamstats04.BamStats05 Error: Could not find or load main class com.github.lindenb.jvarkit.tools.bamstats04.BamStats05 Error: Could not find or load main class com.github.lindenb.jvarkit.tools.bamstats04.BamStats05

lindenb commented 6 years ago

what is the output of

jar tvf /usr/local/jvarkit/dist/bamstats05.jar | grep BamStats05

and

unzip -p /usr/local/jvarkit/dist/bamstats05.jar META-INF/MANIFEST.MF

bgphd commented 6 years ago

Berts-MBP:~ bgold$ jar tvf /usr/local/jvarkit/dist/bamstats05.jar | grep BamStats05

12099 Mon Nov 12 18:38:00 PST 2018 com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.java

Berts-MBP:~ bgold$ unzip -p /usr/local/jvarkit/dist/bamstats05.jar META-INF/MANIFEST.MF

Manifest-Version: 1.0

Htsjdk-Version: 2.15.0

Compile-Date: 2018-11-12:18-11-02

Class-Path: /usr/local/jvarkit/lib/com/github/samtools/htsjdk/2.15.0/h

tsjdk-2.15.0.jar /usr/local/jvarkit/lib/commons-logging/commons-loggi

ng/1.1.1/commons-logging-1.1.1.jar /usr/local/jvarkit/lib/gov/nih/nlm

/ncbi/ngs-java/1.2.4/ngs-java-1.2.4.jar /usr/local/jvarkit/lib/org/ap

ache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar /usr/l

ocal/jvarkit/lib/org/apache/commons/commons-jexl/2.1.1/commons-jexl-2

.1.1.jar /usr/local/jvarkit/lib/org/tukaani/xz/1.5/xz-1.5.jar /usr/lo

cal/jvarkit/lib/org/xerial/snappy/snappy-java/1.1.4/snappy-java-1.1.4

.jar /usr/local/jvarkit/lib/com/beust/jcommander/1.64/jcommander-1.64

.jar /usr/local/jvarkit/dist/bamstats05.jar

Git-Hash: 2be2c5b855f97db5318008ddfe0b1557d61b6a6b

Created-By: 1.8.0_181 (Oracle Corporation)

Main-Class: com.github.lindenb.jvarkit.tools.bamstats04.BamStats05

On Mon, Nov 12, 2018 at 11:41 PM Pierre Lindenbaum notifications@github.com wrote:

what is the output of

jar tvf /usr/local/jvarkit/dist/bamstats05.jar | grep BamStats05

and

$ unzip -p /usr/local/jvarkit/dist/bamstats05.jar META-INF/MANIFEST.MF

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lindenb/jvarkit/issues/116#issuecomment-438166997, or mute the thread https://github.com/notifications/unsubscribe-auth/Ap77L_RArC_m7cQHJAoaiCxU3VWnAsiEks5uuneegaJpZM4Ya1bD .

-- Bert Gold, PhD, FACMGG, CGMB Clinical Molecular Geneticist BillionToOne at StartX 2627 Hanover Street Palo Alto, CA 94304 USA CELL: 302-507-1827

lindenb commented 6 years ago

for an unknown reason, the tool was not compiled ??

there should be a BamStats05.class in the jar

$ jar tvf dist/bamstats05.jar |  grep BamStats05
 12099 Tue Nov 13 18:42:16 CET 2018 com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.java
 14326 Tue Nov 13 18:42:24 CET 2018 com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.class

something failed, during the build. Can you please show me the log of what happens when you're running make bamstats05

bgphd commented 6 years ago

This is what prints out on the command line... If you want a log file, let me know where it is...

Berts-MBP:jvarkit bgold$ make bamstats05

echo "### COMPILING bamstats05 ######"

COMPILING bamstats05

rm -f /usr/local/jvarkit/_tmp-2.15.0/markdown.flag

mkdir -p /usr/local/jvarkit/_tmp-2.15.0/META-INF /usr/local/jvarkit/dist

mkdir -p /usr/local/jvarkit/_tmp-2.15.0/com/github/lindenb/jvarkit/tools/bamstats04/

cp -v "/usr/local/jvarkit/src/main/java/com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.java" "/usr/local/jvarkit/_tmp-2.15.0/com/github/lindenb/jvarkit/tools/bamstats04/"

/usr/local/jvarkit/src/main/java/com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.java -> /usr/local/jvarkit/_tmp-2.15.0/com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.java

echo '### Printing javac version : it should be Oracle 1.8 (you should avoid OpenJDK). if Not, check your ${PATH}.'

Printing javac version : it should be Oracle 1.8 (you should avoid

OpenJDK). if Not, check your ${PATH}.

javac -version 2> bamstats05.jdkversion && cat bamstats05.jdkversion && grep -E '1.8.[0-9_]+' bamstats05.jdkversion && rm bamstats05.jdkversion

javac 1.8.0_181

javac 1.8.0_181

information about the java jre/sdk. For future use of openjdk

echo -n "javac=" > "/usr/local/jvarkit/_tmp-2.15.0/META-INF/jdk.properties"

which javac >> "/usr/local/jvarkit/_tmp-2.15.0/META-INF/jdk.properties"

echo -n "jar=" >> "/usr/local/jvarkit/_tmp-2.15.0/META-INF/jdk.properties"

which jar >> "/usr/local/jvarkit/_tmp-2.15.0/META-INF/jdk.properties"

echo -n "java=" >> "/usr/local/jvarkit/_tmp-2.15.0/META-INF/jdk.properties"

which java >> "/usr/local/jvarkit/_tmp-2.15.0/META-INF/jdk.properties"

echo "classpath=lib/com/github/samtools/htsjdk/2.15.0/htsjdk-2.15.0.jar:lib/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:lib/gov/nih/nlm/ncbi/ngs-java/1.2.4/ngs-java-1.2.4.jar:lib/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar:lib/org/apache/commons/commons-jexl/2.1.1/commons-jexl-2.1.1.jar:lib/org/tukaani/xz/1.5/xz-1.5.jar:lib/org/xerial/snappy/snappy-java/1.1.4/snappy-java-1.1.4.jar:lib/com/beust/jcommander/1.64/jcommander-1.64.jar"

"/usr/local/jvarkit/_tmp-2.15.0/META-INF/jdk.properties"

compile

javac -J-Djvarkit.libs.jars='lib/com/github/samtools/htsjdk/2.15.0/htsjdk-2.15.0.jar:lib/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:lib/gov/nih/nlm/ncbi/ngs-java/1.2.4/ngs-java-1.2.4.jar:lib/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar:lib/org/apache/commons/commons-jexl/2.1.1/commons-jexl-2.1.1.jar:lib/org/tukaani/xz/1.5/xz-1.5.jar:lib/org/xerial/snappy/snappy-java/1.1.4/snappy-java-1.1.4.jar:lib/com/beust/jcommander/1.64/jcommander-1.64.jar' -J-Djvarkit.main.class='com.github.lindenb.jvarkit.tools.bamstats04.BamStats05' -J-Djvarkit.this.dir='/usr/local/jvarkit/' -processorpath /usr/local/jvarkit/dist/annotproc.jar -d /usr/local/jvarkit/_tmp-2.15.0 -g -classpath "lib/com/github/samtools/htsjdk/2.15.0/htsjdk-2.15.0.jar:lib/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:lib/gov/nih/nlm/ncbi/ngs-java/1.2.4/ngs-java-1.2.4.jar:lib/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar:lib/org/apache/commons/commons-jexl/2.1.1/commons-jexl-2.1.1.jar:lib/org/tukaani/xz/1.5/xz-1.5.jar:lib/org/xerial/snappy/snappy-java/1.1.4/snappy-java-1.1.4.jar:lib/com/beust/jcommander/1.64/jcommander-1.64.jar" -sourcepath /usr/local/jvarkit/src/main/java:/usr/local/jvarkit/src/main/generated-sources/java /usr/local/jvarkit/src/main/java/com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.java

create META-INF/MANIFEST.MF

echo "Manifest-Version: 1.0" > /usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF

echo "Main-Class: com.github.lindenb.jvarkit.tools.bamstats04.BamStats05"

/usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF

echo "Htsjdk-Version: 2.15.0" >> /usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF

echo "Class-Path: /usr/local/jvarkit/lib/com/github/samtools/htsjdk/2.15.0/htsjdk-2.15.0.jar /usr/local/jvarkit/lib/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar /usr/local/jvarkit/lib/gov/nih/nlm/ncbi/ngs-java/1.2.4/ngs-java-1.2.4.jar /usr/local/jvarkit/lib/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar /usr/local/jvarkit/lib/org/apache/commons/commons-jexl/2.1.1/commons-jexl-2.1.1.jar /usr/local/jvarkit/lib/org/tukaani/xz/1.5/xz-1.5.jar /usr/local/jvarkit/lib/org/xerial/snappy/snappy-java/1.1.4/snappy-java-1.1.4.jar /usr/local/jvarkit/lib/com/beust/jcommander/1.64/jcommander-1.64.jar /usr/local/jvarkit/dist/bamstats05.jar" | fold -w 71 | awk '{printf("%s%s\n",(NR==1?"": " "),$0);}' >> /usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF

echo -n "Git-Hash: " >> /usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF

cat /usr/local/jvarkit/.git/refs/heads/master >> /usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF

echo -n "Compile-Date: " >> /usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF

date +%Y-%m-%d:%H-%m-%S >> /usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF

create jar

jar cfm /usr/local/jvarkit/dist/bamstats05.jar /usr/local/jvarkit/_tmp-2.15.0/META-INF/MANIFEST.MF -C /usr/local/jvarkit/_tmp-2.15.0 .

create bash executable

echo '#!/bin/bash' > /usr/local/jvarkit/dist/bamstats05

echo -n 'java -Djvarkit.log.name=bamstats05 -Dfile.encoding=UTF8 -Xmx500m ' >> /usr/local/jvarkit/dist/bamstats05

echo -n ' -cp "/usr/local/jvarkit/lib/com/github/samtools/htsjdk/2.15.0/htsjdk-2.15.0.jar:/usr/local/jvarkit/lib/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar:/usr/local/jvarkit/lib/gov/nih/nlm/ncbi/ngs-java/1.2.4/ngs-java-1.2.4.jar:/usr/local/jvarkit/lib/org/apache/commons/commons-compress/1.4.1/commons-compress-1.4.1.jar:/usr/local/jvarkit/lib/org/apache/commons/commons-jexl/2.1.1/commons-jexl-2.1.1.jar:/usr/local/jvarkit/lib/org/tukaani/xz/1.5/xz-1.5.jar:/usr/local/jvarkit/lib/org/xerial/snappy/snappy-java/1.1.4/snappy-java-1.1.4.jar:/usr/local/jvarkit/lib/com/beust/jcommander/1.64/jcommander-1.64.jar:/usr/local/jvarkit/dist/bamstats05.jar" com.github.lindenb.jvarkit.tools.bamstats04.BamStats05 ' >> /usr/local/jvarkit/dist/bamstats05

echo '"$@"' >> /usr/local/jvarkit/dist/bamstats05

chmod ugo+rx /usr/local/jvarkit/dist/bamstats05

generate markdown if needed

if [ -e "/usr/local/jvarkit/_tmp-2.15.0/markdown.flag" ] && [ "" != "true" ] && [ "" != "yes" ] ; then java -jar "/usr/local/jvarkit/dist/bamstats05.jar" --help --helpFormat markdown > "/usr/local/jvarkit/docs/BamStats05.md" ; fi

cleanup

rm -rf "/usr/local/jvarkit/_tmp-2.15.0"

Berts-MBP:jvarkit bgold$

On Tue, Nov 13, 2018 at 9:44 AM Pierre Lindenbaum notifications@github.com wrote:

for an unknown reason, the tool was not compiled ??

there should be a BamStats05.class in the jar

$ jar tvf dist/bamstats05.jar | grep BamStats05 12099 Tue Nov 13 18:42:16 CET 2018 com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.java 14326 Tue Nov 13 18:42:24 CET 2018 com/github/lindenb/jvarkit/tools/bamstats04/BamStats05.class

something failed, during the build. Can you please show me the log of what happens when you're running make bamstats05

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lindenb/jvarkit/issues/116#issuecomment-438367925, or mute the thread https://github.com/notifications/unsubscribe-auth/Ap77L8PgRPSrM3Vi3Zx-DgubMJZuTZNgks5uuwUUgaJpZM4Ya1bD .

-- Bert Gold, PhD, FACMGG, CGMB Clinical Molecular Geneticist BillionToOne at StartX 2627 Hanover Street Palo Alto, CA 94304 USA CELL: 302-507-1827

lindenb commented 6 years ago

hum... no idea, sorry

bgphd commented 6 years ago

The version on my unix machine is working fine...

It's probably a permissions thing on the mac.

I will try to figure it out.

-Bert

On Tue, Nov 13, 2018 at 10:31 AM Pierre Lindenbaum notifications@github.com wrote:

hum... no idea, sorry

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lindenb/jvarkit/issues/116#issuecomment-438384883, or mute the thread https://github.com/notifications/unsubscribe-auth/Ap77LyhtFALkKYWjtR_QHXvDcFA0sFfbks5uuw_wgaJpZM4Ya1bD .

-- Bert Gold, PhD, FACMGG, CGMB Clinical Molecular Geneticist BillionToOne at StartX 2627 Hanover Street Palo Alto, CA 94304 USA CELL: 302-507-1827

lindenb commented 6 years ago

furthermore, compiling in /usr/local is highly unorthodox... you need to be root which is bad...

bgphd commented 6 years ago

where should I put it?

I tried $home/jvarkit and had the same problem!

Bert

On Tue, Nov 13, 2018 at 12:24 PM Pierre Lindenbaum notifications@github.com wrote:

furthermore, compiling in /usr/local is highly unorthodox... you need to be root which is bad...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lindenb/jvarkit/issues/116#issuecomment-438423559, or mute the thread https://github.com/notifications/unsubscribe-auth/Ap77L5c_G8_-YwU5DIQibB6b-GAXm3-Pks5uuyqLgaJpZM4Ya1bD .

-- Bert Gold, PhD, FACMGG, CGMB Clinical Molecular Geneticist BillionToOne at StartX 2627 Hanover Street Palo Alto, CA 94304 USA CELL: 302-507-1827