2

While trying to self teach java I have stumbled upon a problem.

I have a simple GUI applet which I am trying to run.
I am using java 8 version 66. At runtime I get an 'application blocked by Java security' when I try to preview it in a browser using Dreamweaver.
The reason given is that my security settings have blocked a local application from running.
When clicking on the more information link I get info about the java control panel. They instructed to add a url in the exception site list.

When I want to add my dir in this case C:\dwtest\applet\www\html, it won't add to the exception site list.

I have read the documentation for controling an untrusted app running in my browser on https://www.java.com/en/download/help/jcp_security.xml and https://www.java.com/en/download/faq/exception_sitelist.xml. Here they are only discussing about adding an URL and nothing about a directory for where the html and .class files are stored.

Is this really a security issue or am I overlooking something?

I know applets are not used much but I am trying to grasp the concept of it. I think it would increase my over-all knowledge of Java.
Any help would be grealty apreciated.

This is what I know/think I am getting correct:

*1- my html code

<title>HTML Test Page</title>
</head>
<body>
SimpleGui4b will appear in a java enabled browser. <br>
<applet aligned="middle" vspace="0" hspace="0" height="300" width="400" 
name="SimpleGui4b" code="SimpleGui4b.class" codebase="."> wordt niet geladen
</applet>
</body>
</html>]

*2- I have the html file and two .class files in the same dir which is
C:\dwtest\applet\www\html

*3- my class files are working fine as an application in java but not when I made it in to an applet.

*4-dreamweaver has access to C:\dwtest\applet\www\html

Thanks,

XY-bane
  • 31
  • 1
  • 7
  • Your applet must be a signed jar file. Have a look here: https://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html – drkunibar Dec 26 '15 at 23:09
  • When you open local files in a browser, there is usually a `file:///` in the beginning instead of the protocol. Try adding `file:///C:\dwtest\applet\www\html` to the whitelist and/or use `/` instead of \. – Gumbo Dec 26 '15 at 23:41
  • I add **file:///C|/dwtest/applet/www/html/applet.html** and **file:///C|/dwtest/applet/www/html/applet.html\** and **file:///C|/dwtest/applet/www/html** to Exception site list (just to be sure) . The first path is the pathname in dreamweaver . Now I get an explorer content can't be displayed error and browser crashed. When reading https://docs.oracle.com/javase/tutorial/deployment/applet/deployingApplet.html it's stated that I have to get an certificate. but how is this even needed if I add the pathname in the Exception site list? – XY-bane Dec 27 '15 at 15:02
  • the pathenames without the ** though.many thanks – XY-bane Dec 27 '15 at 15:19
  • *"While trying to self teach java I have stumbled upon a problem."* Applets and problems will always be associated. Skip the applet stuff, and you'll avoid moist of those problems. – Andrew Thompson Dec 28 '15 at 00:09
  • Yeah you guys are right. Stomped my head too long on this applet stuff. No one seems to know the answer. – XY-bane Dec 28 '15 at 02:02

1 Answers1

0

I tried looking for a solution to this myself. So far the only solution is to install and use a previous version of java (prior to 8u20). For some reason oracle took away the option to run applets which aren't signed by a trusted authority.

The better question is what is a good alternative to applets now?

kzagon
  • 1
  • I figure that this security issue will always be present. So I just ran the applet in in eclipse. This way I can see if the applet is running without any errors. – XY-bane Jan 12 '16 at 12:14
  • I tried v.7u 79 but to no avail. So running applet in eclipse can still be a good way to practice applets. searching for applet alternative myself. – XY-bane Jan 12 '16 at 12:24