Greetings!
(Dictionary: sjakk = chess)
I've run into problems before when trying to create a jar-file
The issue is discussed here:
http://www.java-forums.org/advanced-...-any-help.html
This is the current problem:
At my College we've had a larger java-project, and it is expected that we will deliver a runable file (in our case a jar-file). We're programming chess, yay.
This involves a lot of classes on this one, but Main.class in the main one.
This is the manifest.txt:
Main-Class: Main
All classes share this in common:
package Sjakk;
This is a issue that was not relevant last time (see link above).
This is the command:
jar cvfm Sjakk.jar manifest.txt *.class
This is what happens when I try to run from Finder:
A message pops up, telling me that "The Java JAR-file "Sjakk.jar" could not be started. Look after error message in the terminal" (translated by me)
This is what happens when I try to run this command:
java Sjakk.jar
Result:
Exception in thread "main" java.lang.NoClassDefFoundError: Sjakk/jar
Caused by: java.lang.ClassNotFoundException: Sjakk.jar
at java.net.URLClassLoader$1.run(URLClassLoader.java: 202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 48)
I haven't tested this out in Windows for the response, yet, but my friend got the message on his computer that the main class could not be found. He typed the exact same command as I.
Interesting side note: If I go to the parent folder, and type "java Sjakk.Main", the Main-class runs as it should.
When running the jar-file generator in NetBeans, we get a program that begins the prosess, but it never continues (the prosess exist, but nothing happens). Testing shows that this method works with more simple codes/project, so I assume this is due to the coding in this case. I assume there is an exception that is thrown, and going into some sort of loop. I don't know if this is relevant to the issue above, since this includes other types of files as well.
Yes, we used NetBeans for this project.
I need response quick. This project is to be handed in tomorrow (current
local time: 6:40 pm).
Thanks! :)

