I'm downloading a File from the Internet (How to download and save a file from Internet using Java?) but I dont want the File to be created before it gets runned. So what I thought was : I download the file put it in a file new File("myJar.jar");
and now instead of doing Runtime.getRuntime().exec("java -jar myJar.jar");
<= (I would need to create the file...) I will unzip the jar and get the bytes of every class and put them into the Classloader to run the program. Is this a good way or what would you recommend? Java: How to load Class stored as byte[] into the JVM? <= Will this run the program if I load every class from the jar?
Edit: This should be done to make crackers a hard time getting the file.
Edit 2: And how would it be possible if its not a jar but a .exe? This is needed when I compile the jar to native code, then its an .exe, so crackers cant get the code out of the jvm.