Try using a fully qualified path to your argparser.jar ie:
java -cp c:\...\argparser.jar
Try adding argparser.jar to your CLASSPATH ie
set CLASSPATH=c:\...\argparser.jar;%CLASSPATH%
There might be code in the ConsoleApp that, for whatever reason, does
some funky Java classloading and thus *requires* the argparser.jar be
in the same directory. But this is way OT for Maven list so please
don't send us the ConsoleApp code or anything...
Wayne
On 10/17/06, Ed Young <[EMAIL PROTECTED]> wrote:
If I could include the argparser.jar file in the console jar file that
would solve my problem, but I'm having trouble figuring out how to do
that.
What I know:
If I put the argparser.jar file in the same directory as the console
app jar file I can run the console app:
C:\src\workspace\seadac-10-2\console>java -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
sea DAC XML ConsoleApp
...but this won't work all the time. If I could include the argparser
(or any other required jar) in the console app jar, I'd be all set.
This part has me stumped:
If I put the argparser jar file anywhere other than the same directory
where the console app jar is, I can't get it to run no matter how I
configure the classpath:
# ls -la
total 138
drwx------+ 6 ???????? 0 Oct 17 22:23 .
drwx------+ 8 ???????? 0 Oct 17 22:23 ..
-rwx------+ 1 ???????? 498 Oct 13 15:36 .classpath
-rwx------+ 1 ???????? 324 Oct 13 15:36 .project
drwx------+ 2 ???????? 0 Oct 13 13:55 .settings
drwx------+ 7 ???????? 0 Oct 13 15:39 .svn
-rwx------+ 1 ???????? 131492 Aug 30 13:44 argparser-1.0.jar
-rwx------+ 1 ???????? 1107 Oct 16 15:53 pom.xml
drwx------+ 4 ???????? 0 Oct 2 15:43 src
drwx------+ 3 ???????? 0 Oct 17 22:21 target
C:\src\workspace\seadac-10-2\console>java -cp .\argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
java -cp .\argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
C:\src\workspace\seadac-10-2\console>java -cp ./argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
java -cp ./argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
C:\src\workspace\seadac-10-2\console>java -cp argparser-1.0.jar -jar
target/comcast-seadac-console-1.0-SNAPSHOT.jar
java -cp argparser-1.0.jar -jar target/comcast-seadac-console-1.0-SNAPSHOT.jar
sea DAC Console APP
Exception in thread "main" java.lang.NoClassDefFoundError:
argparser/StringHolder
at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
I realize that this isn't a maven issue, and is java newbie stuff, but
I feel like I've tried everything classpath-wise and the only solution
is to have the jars all in the same directory.
Where am I going wrong?
Thanks.
On 10/16/06, Eduardo Dela Rosa <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Perhaps your problem lies on this part of your code:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> argparser/StringHolder
> at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
>
> It may not be only about your classpath; To me it means that you're missing
> a jar file (probably a third party library) that has to be inside your
> "console" module.
>
> Check inside the "ConsoleApp.java" and see what classes you are using and
> check your console module jar if the library that contains that class is
> actually inside
> the console module jar file.
>
> This is because in other cases the "NoClassDefFoundError" indirectly
> pertains to the
> another class which is being used by a class that throws the error.
>
> HTH.
>
> On 10/17/06, Ed Young <[EMAIL PROTECTED]> wrote:
> >
> > Thanks for the reply. I know this is something of a newbie issue, so I
> > appreciate your help. It's really got me blocked.
> >
> > I've tried passing the entire path to the jar file including the
> > filename itself and I get the same error.
> >
> > Here's where argparser lives:
> > c:/Documents and
> > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0:
> > total 129 free 22717304
> > drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:45 .
> > drwxrwxrwx 2 eyoung2297c root 0 Aug 30 13:44 ..
> > -rw-rw-rw- 1 eyoung2297c root 131492 Aug 30 13:44 argparser-1.0.jar
> >
> > Here's the command line:
> > C:\src\workspace\seadac-10-2>java -cp "c:/Documents and
> > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-
> > 1.0.jar"
> > -jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > java -cp "c:/Documents and
> > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0/argparser-
> > 1.0.jar"
> > -jar console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > sea DAC Console APP
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > argparser/StringHolder
> > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
> >
> > Or if I put the jar file in the top level of the project and point to it:
> > C:\src\workspace\seadac-10-2>java -cp ./argparser-1.0.jar -jar
> > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > java -cp ./argparser-1.0.jar -jar
> > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > sea DAC Console APP
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > argparser/StringHolder
> > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java:55)
> >
> > Thanks again,
> >
> > Ed
> >
> >
> > On 10/16/06, Wendy Smoak <[EMAIL PROTECTED]> wrote:
> > > On 10/16/06, Ed Young <[EMAIL PROTECTED]> wrote:
> > >
> > > > java -cp "c:/Documents and
> > > > Settings/eyoung2297c/.m2/repository/argparser/argparser/1.0" -jar
> > > > console/target/comcast-seadac-console-1.0-SNAPSHOT.jar
> > > > sea DAC Console APP
> > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > argparser/StringHolder
> > > > at com.comcast.seadac.console.ConsoleApp.main(ConsoleApp.java
> > :55)
> > >
> > > Nothing to do with Maven... you haven't added the argparser jar to
> > > your classpath.
> > >
> > > Make sure you give the path all the way down to the filename of any
> > > .jar files that contain classes you need.
> > >
> > > --
> > > Wendy
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > Ed
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Eduardo Dela Rosa
>
>
--
Ed
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]