I am currently having a problem with running a jar.
This is the exception is gives:
Exception in thread "main" java.lang.NoClassDefFoundError: C:\OptCon/jar
Caused by: java.lang.ClassNotFoundException: C:\OptCon.jar
at java.net.urlClassLoader$1.run(Unknown Source)
at java.seurity.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: C:\OptCon.jar. Program will exit.
Now i checked in my jar file, all the class files are there and the manifest file is created right.
Looks like you're trying to execute a jar file, rather than a class within it. You say you did everything right, but provide no information for us to actually *check*, so we can't help.
Something tells me you tried "java C:\OptCon.jar". This will treat "C:\OptCon.jar" as a class name, not a JAR file. Try "java -h" and see what options you have. Hint: what you need is mentioned all the way at the top. Don't forget to add a Main-Class in your JAR file's manifest file (if you've created it yourself).