Getting Ljava.lang.StackTraceElement error

1,712 views
Skip to first unread message

moshi

unread,
Jan 27, 2010, 10:44:26 AM1/27/10
to H2 Database
Hi,
I developed a jar file that has h2.jar in the classpath.
I run the program in eclipse and everything goes well.
When I execute jar out of my project, and put it in c:
including the h2.jar, and call:
C:\>java -jar myJar.jar classpath c:\h2.jar
I get: Ljava.lang.StackTraceElement .
AnyBody has a clue ?
Thanks

Kerry Sainsbury

unread,
Jan 27, 2010, 2:20:14 PM1/27/10
to h2-da...@googlegroups.com
Not really, but I'd check you've running the same version of java as you used when compiling "myJar.jar".

Perhaps explictly specify the full path to the java.exe in your JDK directory....? (Just a guess!)


--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To post to this group, send email to h2-da...@googlegroups.com.
To unsubscribe from this group, send email to h2-database...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.


michaelm

unread,
Jan 27, 2010, 3:19:22 PM1/27/10
to H2 Database
Hi,

I use to write the classpath before the jar file containing the main.
java doc says :
java [ options ] -jar file.jar [ argument ... ]
(options includes the classpath)

Could it be the problem ?

Michaël

On 27 jan, 20:20, Kerry Sainsbury <ke...@fidelma.com> wrote:
> Not really, but I'd check you've running the same version of java as you
> used when compiling "myJar.jar".
>
> Perhaps explictly specify the full path to the java.exe in your JDK
> directory....? (Just a guess!)
>

> On Thu, Jan 28, 2010 at 4:44 AM, moshi <mosh...@gmail.com> wrote:
> > Hi,
> > I developed a jar file that has h2.jar in the classpath.
> > I run the program in eclipse and everything goes well.
> > When I execute jar out of my project, and put it in c:
> > including the h2.jar, and call:
> > C:\>java -jar myJar.jar classpath c:\h2.jar
> > I get: Ljava.lang.StackTraceElement .
> > AnyBody has a clue ?
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "H2 Database" group.
> > To post to this group, send email to h2-da...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > h2-database...@googlegroups.com<h2-database%2Bunsu...@googlegroups.com>

Kerry Sainsbury

unread,
Jan 27, 2010, 4:25:44 PM1/27/10
to h2-da...@googlegroups.com
I think you have a typo. It should be -classpath, nor classpath, and also it might be easier initially to specific your "main" method.

Try something like:

d:\Java\jdk1.5.0_14\bin\java -classpath myJar.jar;c:\h2.jar com.example.YourMainClass

... I'm assuming you haven't setup a manifest specifying your "main" class

Cheers
Kerry



To unsubscribe from this group, send email to h2-database...@googlegroups.com.

moshi

unread,
Jan 28, 2010, 2:20:17 AM1/28/10
to H2 Database
Hi guys,
thanks for your advices.
I tried:
java -jar myJar.jar -classpath h2.jar
java -classpath h2.jar -jar myJar.jar
About the java, I installed the java in my machine,
and developed the jar on it, and I run it on it. It is
same java, same version.
The main issue is that the program runs fine in Eclipse
as a simple program. When I execute a jar out of it,
the problems begin.
I don't have any clue...
If you have another advice, I'd be glad to here.
Thanks.

> > > > h2-database...@googlegroups.com<h2-database%2Bunsubscribe@googlegr­oups.com>
> > <h2-database%2Bunsu...@googlegroups.com<h2-database%252Bunsubscribe@goo­glegroups.com>


>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/h2-database?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "H2 Database" group.
> > To post to this group, send email to h2-da...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > h2-database...@googlegroups.com<h2-database%2Bunsubscribe@googlegr­oups.com>


> > .
> > For more options, visit this group at

> >http://groups.google.com/group/h2-database?hl=en.- Hide quoted text -
>
> - Show quoted text -

moshi

unread,
Jan 28, 2010, 3:57:40 AM1/28/10
to H2 Database
Hi, I solved it by adding manifest contains the classpath.
It is needed when a jar file uses another jar.
Thanks a lot anyways !

> > >http://groups.google.com/group/h2-database?hl=en.-Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -

Thomas Mueller

unread,
Jan 29, 2010, 2:25:21 PM1/29/10
to h2-da...@googlegroups.com
Hi,

I guess what you wanted is (Windows):
java -cp h2.jar;myJar.jar -jar myJar.jar

or for Linux / OS X:
java -cp h2.jar:myJar.jar -jar myJar.jar

Regards,
Thomas

北出秀行

unread,
Jan 29, 2010, 6:44:59 PM1/29/10
to h2-da...@googlegroups.com

2010/01/30 4:25 "Thomas Mueller" <thomas.to...@gmail.com>:

-- You received this message because you are subscribed to the Google Groups "H2 Database" group. ...

Reply all
Reply to author
Forward
0 new messages