> 1. You can't launch a Java application using the "java" command, and
> using both the -jar (specifies a jar file) option and the -cp
> (specifies a classpath) option. They're mutually exclusive. If you use
> the -jar option, then the -cp is completely ignored.
Which is well documented, but java users typically prefer to ignore that
part of the documentation and learn it the hard way.
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html#-jar
> 2. You can add a 'Class-Path' entry in the manifest file, MANIFEST.MF
> file (see http://java.sun.com/j2se/1.3/docs/guide/jar/jar.html).
Why are you using such an ancient Java version?
> But
> you have to be very cautious with it. Several rules apply in the way
> you specify your class path:
> - Class-Path line can't be longer than 72 chars (nice one).
Which is well documented.
http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html
> - You can break a classpath line into several, but you have to make
> the line separation as CR[space][space] (see
[quoted text clipped - 6 lines]
> - The classpath line must be finished by a carriage return (CR, LF,
> or CRLF).
All documented. The [space][space] issue is tricky, but also documented.
It allows to break single long pathes over multiple lines without
accidentally inserting a space in the path.
> 3. If there is a INDEX.LIST besides the MANIFEST.MF, then the class
> path specified in the manifest is ignored.
No, the manifest is initially used to create an index by the jar tool.
There is a bug in jar, which manifests itself in the way that index
entries are created with an absolute path instead of a relative one, but
that problem is easy to circumvent.
> the jar libraries included in your jar have this INDEX.LIST file. When
> you build your jar, you have to break up all jar libraries, and
> recompile them into one big fat jar.
No. This is often claimed, but not true. The default class loader can't
load jars from a jar (which is well documented), but that does in no way
mean one has to unpack and repack all jars (with stupid tools like
FatJar). Setting the Class-Path in the main jar and deploying multiple
jars (probably via JWS) works well.
There are people who claim they have written "jar-in-jar" class loaders.
I haven't seen a working one.
> Some (undesirable?) INDEX.LIST may
> pop out to the META-INF folder.
Index files in secondary (other than the main jar) jars are ignored.
Please submit a bug report to sun if you have a reproducible example
demonstrating otherwise.
> The last point took me some time to figure out. In my case, the culprit
> was mysql-connector-java-3.1.11-bin.jar.
The culprit was likely your attempt to build a "fat" jar.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/