Sample Header Ad - 728x90

Setting classpath for Java

3 votes
1 answer
3569 views
I was trying to use a tool a tool written in java called "fastqc" (for people who are interested in what is fastqc . when I tried typing the command :" fastqc" I got the error: Exception in thread "main" java.lang.NoClassDefFoundError: uk/ac/babraham/FastQC/FastQCApplication Caused by: java.lang.ClassNotFoundException: uk.ac.babraham.FastQC.FastQCApplication at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:323) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:268) when someone had similar previously,some one suggested that in similar case, I need to set the class path to the directory which contains FastQC installation : and depending on having a standard class path or non-standard classpath on my machine, I need to append existing classpath like: java -Xmx250m -classpath /usr/local/FastQC uk.ac.bbsrc.babraham.FastQC.FastQCApplication or java -Xmx250m -classpath /usr/local/FastQC:$CLASSPATH uk.ac.bbsrc.babraham.FastQC.FastQCApplication Since my directory which contains the FastQC is /u32/myusername/Tool/FastQC so I tried both: java -Xmx250m -classpath /u32/myusername/Tool/FastQC uk.ac.bbsrc.babraham.FastQC.FastQCApplication and java -Xmx250m -classpath /u32/myusername/Tool/FastQC:$CLASSPATH uk.ac.bbsrc.babraham.FastQC.FastQCApplication but none of them seemed to work. Did I mess something up? I am not sure about what -Xmx250m means, with or without it, the path setting did not work. Sorry for my ignorance. Any idea or suggestion appreciated.
Asked by Jun (541 rep)
Aug 6, 2016, 08:02 AM
Last activity: Jul 12, 2025, 10:06 PM