• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Sealing Jars  RSS feed

Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have never tried the Jar Sealing facility of Java before, but was in the area and thought I'd try it. But it doesn't seem to have the effect I expected.

As a first step, I added a manifest to all my Jars. Example (taken directly from the Jar): -

Now I know that several of my packages have their contents spread around two Jars (an interface and an implementation Jar). I thought that sealing all the Jars would therefore cause a SecurityException, verifying that I had successfully sealed them (*). But in fact, the whole application ran fine.

My program has a custom class loader for all classes, though the loading of most classes eventually ends up being done by the system class loader. My program has no SecurityManager. But I thought that Jar sealing was independent of class loader and required no SecurityManager.

Any suggestions why I didn't get a SecurityException?

(*) If I'd not failed at the first hurdle, I'd probably have gone on to restrict sealing to a subset of my Jars.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!