Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Java Firefox Applet
Hello,
 
I'm building java applet in notepad++ not in some IDE. How can I give this applet all permissions (for opening and writting to socket) for testing. I'm asking this because now I need to deploy applet to server each time!
 
If I run applet from developing computer and I want to connect to socket on server which is not on localhost I get exception.
 
So I'm asking if there is any way to give all or only this applet all permissions in browser?
Posted 19-Dec-12 7:24am
aselan810

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I'm building java applet in notepad++ not in some IDE
 
There's your fault. WHY?
 
Add a file "policy.policy" to the project and put in there the following:
 
grant {
  permission java.security.AllPermission;
};
 
the start the app with the argument:
 
java -Djava.security.policy=policy.policy MyFunkyApplication
  Permalink  
Comments
aselan at 20-Dec-12 2:41am
   
At first thank you for your quick response!
 
I only have 320 KB space, for CSS, HTML, Java applet and JavaScript code, that's why I'm not doing this with IDE, because it generates a lot of unnecessary files.
 
I know about policy file, but I can't use it without IDE, or not?
TorstenH. at 20-Dec-12 3:55am
   
no, the argument thingy is just a fancy little confusion brought into this by me.
sure you can, how do you start the applet?
 
There is also a code based version, please refer to google for that.
aselan at 20-Dec-12 4:09am
   
I start applet in web browser, I run index.html with applet and I get security exception for opening Soceket on server machine (let's say on IP 192.168.1.10). If I upload it on server (which is on IP 192.168.1.10), it works! I would like to develop app on developmetn machine and opening socket on server. Now I must upload it each time.
 
I google it but you can give java applet permissions only through IDE.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 195
1 ProgramFOX 130
2 Maciej Los 105
3 Afzaal Ahmad Zeeshan 82
4 Sergey Alexandrovich Kryukov 75
0 OriginalGriff 6,564
1 Sergey Alexandrovich Kryukov 6,048
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web02 | 2.8.1411022.1 | Last Updated 19 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100