I downloaded the Javax.mail package. I have jdk1.6.0_11. Problem is...I cannot get javac or java to find those classes! I can get apps to compile using JCreator LE ( by adding the mail jar to its search list ) but, when I try to run the app in a command window, it fails.
Can I add these new classes to the rt.jar without hurting my jdk installation? I know java has it wired up to look there for classes. (And, the mail classes are inside a javax package - seems like they could reasonably be added to the javax folder in rt.jar..
Thanks! Phil D'
No you can't, nor should you.
Instead, figure out the problem with your classloader (probably paths?). You'll need that for the next library you need to access.
Messing with rt.jar means you can't run on any other JVM.
You should either specify the jar file in your classpath: preferably on the command line with the -cp
option, but possibly with the CLASSPATH
environment variable.
Alternatively, you can specify its directory in the java.ext.dirs
system property. For more details, see the documentation for the extensions mechanism.
You shouldn't be messing around with rt.jar
. That's very definitely not the way to make extra jar files available - it's akin to trying to add Microsoft Word to the Windows kernel ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With