By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,602 Members | 1,457 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,602 IT Pros & Developers. It's quick & easy.

classpath problems with jar files

P: n/a
okay, i have an odd problem... and maybe it's platform-specific... but i
figure give it a shot and ask about it in case someone has seen this.

i have an application that is made up of numerous class files. this
application at one point loads a class from another company using the
command Class.forName(...).

when i compile the .java files to bytecode and execute from the main()
entry point, it works fine.

than i create a jar file, and include a manifest line to point to the
class containing the main() entry point. then i execute the jar file
(java -jar jarfile).

the program starts running fine, but throws a class not found exception
when it hits the Class.forName() line.

everything else is the same... same classpath setting, and the other class
files haven't moved (the other classes are in fact in a jar file which is
included in the classpath).

so to sum it up... app works fine when not in jar file. jar it up, and
run with everything else the same... cannot load some external classes.

now, i am running jdk1.4.1 on mac os x.

any thoughts?

murat

--
Murat Tasan
mx**@po.cwru.edu
ta***@eecs.cwru.edu
mu*********@cwru.edu
http://genomics.cwru.edu

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.