Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have ubuntu 12.04.1 nad running java 6. I set the CLASSPATH to /usr/lib/jvm/java-6-openjdk-amd64/bin so that if I do


I get


In that folder I have a jar file called MarkDuplicates.jar, but when I try to run it with

 $ java -jar MarkDuplicates.jar 

I get

Unable to access jarfile MarkDuplicates.jar

I would like to use that folder to add more jar files so that they become easily accesible. If I run

java -jar $CLASSPATH/MarkDuplicates.jar

then the program DOES run, any help?

share|improve this question
Is the program located in the current directory? –  MiJyn Jan 8 '13 at 1:34
MarkDuplicates.jar is located in /usr/lib/jvm/java-6-openjdk-amd64/bin –  Julio Diaz Caballero Jan 8 '13 at 1:37
When running java -jar MarkDuplicates.jar, you are asking it to access a 'MarkDuplicates.jar' which, you say, is in the current directory. The JAR runner does not care about $PATH or $CLASSPATH when trying to find the jar file, it uses normal shell pathnames. Therefore, you will have to either give a relative or absolute pathname to 'MarkDuplicates.jar' –  MiJyn Jan 26 '13 at 23:04
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.