JAR Files and no classpath

Hi.

I've never used jar files in the past, but netbeans 4.0 packages the files so nicely :)

Problem is, you can't use any external jar files in the classpath. This really is a problem if you want to include JDBC drivers or anything else for that matter. Adding the classpath to the manifest file also didn't work.

I finally ended up unjarring oracles jar and adding all the classes into my jar file. Works fine now, just a "fat" installation.

Are there any easy ways around this? Maybe like setting the classpath at runtime before the driver gets initialized?

Thanks!

Andi

[618 byte] By [andireinbrecha] at [2007-10-1 3:04:58]
# 1
Either post your manifest for someone to see or search across these forms for others that have this problem. There must be some problem with the manifest.rykk
rykk.a at 2007-7-8 21:36:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2

> I've never used jar files in the past, but netbeans

> 4.0 packages the files so nicely :)

Look at the javadocs for jar.exe to see how to do it without NetBeans. You should know how to do it and what NetBeans is putting in there for you.

> Problem is, you can't use any external jar files in

> the classpath.

Wrong.

> This really is a problem if you want

> to include JDBC drivers or anything else for that

> matter. Adding the classpath to the manifest file

> also didn't work.

Yes, it does. Add the CLASSPATH and deploy the 3rd party JARs with your JAR.

> I finally ended up unjarring oracles jar and adding

> all the classes into my jar file. Works fine now,

> just a "fat" installation.

Terrible idea, even if it "worked". You shouldn't unpack 3rd party JARs. Better to learn how to do it correctly.

> Are there any easy ways around this? Maybe like

> setting the classpath at runtime before the driver

> gets initialized?

Yes - learn how CLASSPATH works. Is your problem using an executable JAR? Study up on that.

%

duffymoa at 2007-7-8 21:36:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
So, what is the correct ways ?
cakaua at 2007-7-8 21:36:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
hi I think you can change the batch file for execution by -cp variable.Retheesh
retheesh.ra at 2007-7-8 21:36:15 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...