G
Guest
Hi !
I have a problem with the classpath within the manifest file:
Note: The names are changed due the company policy
I am using MsSQL libraries, and some of my own, which resides in \myjava
directory.
Demo is main class.
If I run java manually:
C:\project>java -cp .;\java\bin;\myjava;\java\lib\msutil.jar;\java\lib
\msbase.jar;\java\lib\mssqlserver.jar;Demo.jar Demo
it works.
If the same JAR file is started with:
C:\project>java -jar Demo.jar
I get
Exception in thread "main" java.lang.NoClassDefFoundError:
myjava/prjname/prjclass
All imports and classes are properly specified (otherwise it would run
as the first example shows)
***
Ok, now my manifest file, which is put in my jar file.
Manifest-Version: 1.0
Created-By: 1.4.2_03 (Sun Microsystems Inc.)
Main-Class: Demo
Class-Path: . \java\bin \myjava
\java\lib\msutil.jar
\java\lib\msbase.jar
\java\lib\mssqlserver.jar
But when I include that manifest with jar command, and examine it in jar
file,
it seems that it breaks lines by himself
I need to cut lines into several lines due the 70 CHARS restriction.
In documentation it says:
Line length:
No line may be longer than 72 bytes (not characters), in its UTF8-
encoded form.
If a value would make the initial line longer than this, it should be
continued
on extra lines (each starting with a single SPACE).
Any hint ?
I have a problem with the classpath within the manifest file:
Note: The names are changed due the company policy
I am using MsSQL libraries, and some of my own, which resides in \myjava
directory.
Demo is main class.
If I run java manually:
C:\project>java -cp .;\java\bin;\myjava;\java\lib\msutil.jar;\java\lib
\msbase.jar;\java\lib\mssqlserver.jar;Demo.jar Demo
it works.
If the same JAR file is started with:
C:\project>java -jar Demo.jar
I get
Exception in thread "main" java.lang.NoClassDefFoundError:
myjava/prjname/prjclass
All imports and classes are properly specified (otherwise it would run
as the first example shows)
***
Ok, now my manifest file, which is put in my jar file.
Manifest-Version: 1.0
Created-By: 1.4.2_03 (Sun Microsystems Inc.)
Main-Class: Demo
Class-Path: . \java\bin \myjava
\java\lib\msutil.jar
\java\lib\msbase.jar
\java\lib\mssqlserver.jar
But when I include that manifest with jar command, and examine it in jar
file,
it seems that it breaks lines by himself
I need to cut lines into several lines due the 70 CHARS restriction.
In documentation it says:
Line length:
No line may be longer than 72 bytes (not characters), in its UTF8-
encoded form.
If a value would make the initial line longer than this, it should be
continued
on extra lines (each starting with a single SPACE).
Any hint ?