Guru
Date of registration: Dec 11th 2001
Location: Hämelerwald
Occupation: Wissenschaftlicher Mitarbeiter (Forschungszentrum L3S, TU Braunschweig)
Du möchtest also wissen, wie man JAR-Pakete erstellt?Quoted
Original von Nadja
Was ist jetzt mit .jar ?????
Wie kann man aus eine Datei mit der Endung .java eine Datei mit der Endung .jar erstellen..
This post has been edited 2 times, last edit by "Joachim" (May 17th 2006, 7:15pm)
Quoted
JAR files are packaged with the ZIP file format, so you can use them for "ZIP-like" tasks such as lossless data compression, archiving, decompression, and archive unpacking. These are among the most common uses of JAR files, and you can realize many JAR file benefits using only these basic features.
[...]
To perform basic tasks with JAR files, you use the JavaTM Archive Tool provided as part of the Java Development Kit. Because the Java Archive tool is invoked by using the jar command, for convenience we'll call it the "Jar tool".
Source code |
|
1 |
jar cf meinjar.jar meinjava.java |
Quoted
The basic format of the command for creating a JAR file is:
jar cf jar-file input-file(s)
Let's look at the options and arguments used in this command:
* The c option indicates that you want to create a JAR file.
* The f option indicates that you want the output to go to a file rather than to stdout.
* jar-file is the name that you want the resulting JAR file to have. You can use any filename for a JAR file. By convention, JAR filenames are given a .jar extension, though this is not required.
* The input-file(s) argument is a space-separated list of one or more files that you want to be placed in your JAR file. The input-file(s) argument can contain the wildcard * symbol. If any of the "input-files" are directories, the contents of those directories are added to the JAR archive recursively.
The c and f options can appear in either order, but there must not be any space between them.
This command will generate a compressed JAR file and place it in the current directory. The command will also generate a default manifest file (in the Deployment trail) for the JAR archive.
Turner, Serveradmin & Workaholic
Date of registration: Apr 25th 2006
Location: Südstadt
Occupation: (iter (B.Sc. Inf, 8)) \n (be-a-slave ("SRA", "Bachelor Thesis")) \n (be-a-programmer-slave ("Freelancer", "Programming"))
Source code |
|
1 |
Main-Class: fruehlingssimulation/Simulation |
Source code |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ java Simulation Exception in thread "main" java.lang.NoClassDefFoundError: Simulation (wrong name: fruehlingssimulation/Simulation) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:620) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$100(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319) |
This post has been edited 1 times, last edit by "Warui" (May 20th 2006, 1:34pm)