classpath trouble with my .jar [message #227595] |
Wed, 15 August 2007 17:07  |
Eclipse User |
|
|
|
Originally posted by: afrancoc2000.hotmail.com
Hi,
I'm new at eclipse and I'm trying to create a .jar file that needs two
other different .jars to work well, jbcl.jar for borland layouts igot from
jBuilder, and mysqlConector.jar, for comunication with a data base in
mySql.
I have JDK 1.6 and i'm working at a 6.0 compliance level, I usually
execute my jars directly from windows, but with eclipse they don't work, I
have my java build path configured, but it seems like it doesn't go to the
manifest, my system classpath doesn't seem to work either, when I try
executing the jar from the console.
I do it like this:
java -cp "C:\Borland\JBuilder2005\lib\jbcl.jar" "C:\Archivos de
programa\Java\mysqlConnector\mysqlConnector.jar" -jar admin.jar
and when I try to modify the manifest directly there is a problem and
eclipse tells me that it couldn't generate the jar file because the
manifest is not sincroniced with the application.
I change my manifest like this:
Manifest-Version: 1.0
Main-Class: main.Main
Class-Path: "C:\Borland\JBuilder2005\lib\jbcl.jar" "C:\Archivos de
programa\Java\mysqlConnector\mysqlConnector.jar"
Can any body help me with this? I'm kind of lost. :(
Thanks
|
|
|
|
Re: classpath trouble with my .jar [message #227672 is a reply to message #227595] |
Wed, 15 August 2007 22:11   |
Eclipse User |
|
|
|
Ana wrote:
> Hi,
>
> I'm new at eclipse and I'm trying to create a .jar file that needs two
> other different .jars to work well, jbcl.jar for borland layouts igot
> from jBuilder, and mysqlConector.jar, for comunication with a data base
> in mySql.
>
> I have JDK 1.6 and i'm working at a 6.0 compliance level, I usually
> execute my jars directly from windows, but with eclipse they don't work,
> I have my java build path configured, but it seems like it doesn't go to
> the manifest, my system classpath doesn't seem to work either, when I
> try executing the jar from the console.
>
> I do it like this:
>
> java -cp "C:\Borland\JBuilder2005\lib\jbcl.jar" "C:\Archivos de
> programa\Java\mysqlConnector\mysqlConnector.jar" -jar admin.jar
>
> and when I try to modify the manifest directly there is a problem and
> eclipse tells me that it couldn't generate the jar file because the
> manifest is not sincroniced with the application.
>
> I change my manifest like this:
>
> Manifest-Version: 1.0
> Main-Class: main.Main
> Class-Path: "C:\Borland\JBuilder2005\lib\jbcl.jar" "C:\Archivos de
> programa\Java\mysqlConnector\mysqlConnector.jar"
>
> Can any body help me with this? I'm kind of lost. :(
>
> Thanks
>
>
>
You want both jbcl.jar and mysqlConnector.jar on the classpath, right?
Try
java -cp "c:\...\jbcl.jar;c:\...\mysqlConnector.jar;admin.jar" main.Main
and see if that works. Note that I put the program jar file in the
classpath, and that class path entries are separated by semicolons.
(Fill in the ellipsis, of course; I just put ... because I'm lazy.)
/Paul
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: classpath trouble with my .jar [message #228136 is a reply to message #228100] |
Fri, 17 August 2007 20:24  |
Eclipse User |
|
|
|
Originally posted by: afrancoc2000.hotmail.com
Hi guys,
I know now what was wrong, I'm using an absolute path in the class-path at
the manifest and it has to be a relative one, so it never finds the jars
it needs.
ChuckBing at the java forums find it out!!
Thank you all you've been great,
Ana
|
|
|
Powered by
FUDForum. Page generated in 0.09850 seconds