You need to specify the classpath property in the jar's manifest file.

http://java.sun.com/docs/books/tutorial/jar/basics/manifest.html

-Clark


-----Original Message-----
From: jython-users-admin@lists.sourceforge.net on behalf of Oti
Sent: Thu 11/25/2004 3:19 PM
To: Tony Maniaci; jython users
Subject: Re: [Jython-users] Executing jython compiled jars

Toni,

IMHO the -cp or -classpath option is ignored when you use
  java -jar jarfile
I tried this lately, and
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html
says:

"""
-jar
    Execute a program encapsulated in a JAR file. <snip>

    When you use this option, the JAR file is the source of all user
classes, and other user class path settings are ignored.
"""

Best wishes,
Oti.

--- Tony Maniaci <tmaniaci@tracs5.com> wrote:

> Hi,
>
> I bundled jython compile classes in a jar but I get the error below.
> It
> runs fine when run the compiled classes directly. What am I missing
> in
> the jar? I'm on java 1,4,2 with jython 2.1
>
> C:\jython-2.1\jpywork2>jar cvfm ProcessMgr.jar manifest.txt *.class
> added manifest
> adding: ProcessMgrSW$_PyInner.class(in = 17032) (out= 7837)(deflated
> 53%)
> adding: ProcessMgrSW$MainFrame.class(in = 5547) (out= 2213)(deflated
> 60%)
> adding: ProcessMgrSW.class(in = 6497) (out= 2872)(deflated 55%)
>
> C:\jython-2.1\jpywork2>java -cp C:\jython-2.1\jython.jar;. -jar
> ProcessMgr.jar
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/python/core/PyObject



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users