Does someone know how I can secure my applets?
When I've create a "great" program-applet and I wanna show it on the internet, but I won't someone can visit the .class files.
My question again:
Does someone how I can put my applet-file on the internet without that someone can visit the .class files.
i guess you can try to create a custom url class loader that fetches the class files in a non obvious way from your server where they are hosted. for example, instead of a folder containing jar files that is directly invokable with a GET HTTP request from a web browser, create a servlet that reqires some kind of custom authentication and a POST request or something. Where your custom class loader would invoke this kind of extra steps to get the content from the servlet.
Nothing is ever completely fool proof here, if someone really really wanted to get the application code, they would be able to eventually learn how the class loader works.
Another approach might be to obfuscate your code. where all of the compiled class files would be available for anyone to download, but they would be not obvious as to what they are doing anymore.
A third option might be to rearchitect the applet so that instead of needing to have class files visible at all for download to run in the applet, to create a kind of service oriented mechanism where the applet makes a web service kind of call out to a server that has a receiver servlet to listen to these service requests, and the services invoke your super special application code. this way the application logic is split into two tiers, the client applet class files we give away, and the server side you control and maintain and never give away. The obvious problem here is the induced latencies from needing to make web service calls, and your infrastructure needing to be able to handle as many users of the applet you expect there to be, and having your site always up in a fixed URL.
So the best bet is to probably try to obfuscate your codes.