This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LOCAL third party JAR FILE

 
Rakesh Ray
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, my applet is using third party API's bundled in JAR file.
To avoid downlaod each time I copied the JAR file on users PC.
Everything is fine if that file is there at a perticular location.
In case the JAR file is not there in user's PC class loader in the browser fails. Is there anywayof catching it and give proper message to user. In IE I can catch ClassNotFound exception in the constructor of the applet. For netscape it is not even coming to my code?
Any suggestions..
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18276
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how well that works. The applet classloader may reject a third-party JAR if it's not signed. This would be to avoid "Trojan" jars from being substituted, violating the integrity of the system. It's also probably too much work, since the applet classloader will generally cache the jar anyway.
 
Rakesh Ray
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx for reply Tim.
Can you please explain the last line, I did not understand it.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18276
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In most cases your web browser will download the jar once and save it in a temporary (cache) directory. Then when the user revisits that web page and needs the jar again, instead of downloading the jar again, the java VM uses the copy that was stored in the cache.
The cache eventually gets cleared out, however. Otherwise your hard drive might fill up with cached stuff. Also, you don't want the user to be working with an old, out-of-date copy of the jar.
How long an item remains in cache is dependent on the browser. Most browsers allow the user to fine-tune this interval from no-caching all the way up to possibly forever.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic