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
> 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.
%