COMP 310
|
Java Tips and Traps
|
|
This is a collection of suggestions and warnings about common Java problems.
Quick Links:
Application Blocked by Security Settings
Symptoms:
- When you try to run the application you get an error that says
something like "Application Blocked by Security Settings".
- There may be additional error messages saying that the application
cannot be run due to security issues.
- An applet does not appear in a browser (this might be
another issue though)
- Java Web Start ("JWS") application won't launch.
Possible Cause:
The Java security settings in your system are not
allowing the desired application or applet to run because it is untrusted.
Try this:
Add the application or the applet's URL to the "Exception
Site List" in the Java Control Panel
- Find the Java Control Panel in your system:
- Windows: In the Control Panel, click the "Java" icon.
- Mac: In System Preferences, click the "Java" icon.
- Under the "Security" tab, click on the "Edit Site List" button
- Add the URL of the application
- For an applet or JWS application, if you add the root URL of the site then all applets
or JWS applications from that site will be allowed to run. For example, add the
"
https://www.clear.rice.edu
" URL to the exceptions list.
- For an application on one's disk, specify a URL of the form
"
file://....
" that points to the application location on your disk.
Enable the Java console
When one is having problems launching or running Java
applets or Java Web Start ("JWS") applications, it is highly recommended that
the Java console be enabled so one can see error messages when
applets or JWS applications start up and run. This can help you debug problems
by showing you the Java error messages that are generated. Select these
options under the "Advanced" tab of the Java Control Panel:
- Debugging: Check all the boxes so that all possible error messages
and program information are logged.
- Java Console: Select "
Show console
" to always open when an
applet or JWS application is launched. This can be set to "Hide
console" once the problem is resolved.
References:
Applet Won't Run in Browser
Symptoms:
- An applet does not appear in a browser (this might be
another issue though)
Possible Cause:
The latest version of Chrome and the Microsoft Edge
browser do not support the running of Java applets. (Technically,
they no longer support the "NPAPI" ("Netscape Plug-in API") plugin format that
Java uses due to security and other concerns.)
The security settings in the browser do not allow the
applet to run.
Try this:
- Open the page in another browser such as Firefox, Internet Explorer or
Safari
- In the Edge browser, you can quickly open the same page in Internet
Explorer by clicking the "More Actions" button (shown as ellipses "..."
on the upper right) and selecting "Open with Internet Explorer".
- For directions on how set the security preferences to allow applets in
Internet Explorer, Firefox and Safari, please see the Oracle site:
How do I enable Java in my web browser?
References:
© 2017 by Stephen Wong