Hi all,
I am using MITMPROXY in transparent mode
and made apr spoofing and iptables to redirect traffic on port 80 to the port MITMPROXY is listening to
then a simple python script that will add simple script tag in the HTTP response returned to the victim
the problem is as follows

1- with basic script (alert box) it works fine
2- tried to generate JAR file using msfvenom, and inserted APPLET in the html response to the victim, the victim browser throws this error :

jar.png

3-when trying to run the JAR file directly , it works fine and java meterpreter session opens normally
the question is, why it doesn't work in the browser, how to make it work?