Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I run a jar file?

I tried this : java iCChecker.jar

but I got next trace :

Exception in thread "main" java.lang.NoClassDefFoundError: iCChecker/jar
Caused by: java.lang.ClassNotFoundException: iCChecker.jar
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: iCChecker.jar.  Program will exit.

So, what am I doing wrong? And how to start this jar file?

share|improve this question
up vote 4 down vote accepted

To run a jar file, pass the -jar option to java. Otherwise it assumes the given argument is the name of a class, not the name of a jar file (specifically in this case it's looking for a class named jar in a the package iCChecker).

So java -jar iCChecker.jar will work.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.