Hi, I solved it by adding manifest contains the classpath. It is needed when a jar file uses another jar. Thanks a lot anyways !
On Jan 28, 9:20 am, moshi <[email protected]> wrote: > 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. > > On Jan 27, 11:25 pm, Kerry Sainsbury <[email protected]> wrote: > > > > > 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 > > > On Thu, Jan 28, 2010 at 9:19 AM, michaelm <[email protected]> wrote: > > > 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 <[email protected]> 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 <[email protected]> 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 [email protected]. > > > > > To unsubscribe from this group, send email to > > > > > [email protected]<h2-database%2bunsubscr...@googlegroups.com> > > > <h2-database%[email protected]<h2-database%252bunsubscr...@googlegroups.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 [email protected]. > > > To unsubscribe from this group, send email to > > > [email protected]<h2-database%2bunsubscr...@googlegroups.com> > > > . > > > For more options, visit this group at > > >http://groups.google.com/group/h2-database?hl=en.-Hide quoted text - > > > - Show quoted text -- Hide quoted text - > > - Show quoted text - -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
