Sign in to follow this  
Ronnie Mado Solbakken

Java Sec. Levels and Running my .Jar File

Recommended Posts

Hey, I got this weird problem with trying to run the Applets that I created. In short I'm simply unable to run them.

 

I have created a working Java code and an HTML page that runs the Applet "window" without problems. But I got a problem getting blocked by Javas security level (High). I then proceed to set this to Medium (in the Java Control Panel) but, the minute I restart the Applet, I keep getting blocked. When I revisit the Java Control Panel, I notice that the security level has been reset to High. In effect, I not only seem unable to change my security level, but I would also like to know how I can run my Applet even if the security level is high.

 

____________________

 

Application Blocked by Security Settings

 

Name: net.malabyte.MinefrontApplet

 

Location: file:/C:/Malabyte/Games/

 

Your security settings have blocked a local application from running

____________________

 

 

What's going on? My HTML and Java code has been copied verbatim with zero errors off of TheCherno on Youtube (from his serious on 3D Game Programming) and he's got no issues with it himself. I also have a direct .Jar file compiled and it runs without problems. I run Win7 and got Java 1.7.0_15-b03.

 

Thanks in advance.

Edited by Malabyte

Share this post


Link to post
Share on other sites
Bracket    240

I've run into similar situations before, mostly when writing a file upload tool for a client (it ran as an applet that collected vast quantities of images from photographers, did post-processing on them, and uploaded them to the customer's content manager). Any time I tried to use anything more than simple writing to the screen (such as accessing sockets for the upload), my applet was blocked.
I found two solutions, both of which were needed for reliable functionality:

  • Make sure that the browser's Java plugin is up-to-date.
  • Digitally sign your applet.

You can use a self-generated cert at no cost; users will see a "this application was signed by <your name>, trust it?" type prompt when it runs, but until you're ready for a public release that's fine. There's a decent tutorial on the signing process here: http://www-personal.umich.edu/~lsiden/tutorials/signed-applet/signed-applet.html

 

I'd recommend putting the signing process into your build-chain. I use NetBeans (which in turn uses ant), so it was relatively painless to do so for me - and it's a lot easier to build and sign in one click!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this