从URL加载jar [英] Load jar from URL

查看:113
本文介绍了从URL加载jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找几天,但我没有找到明确的答案。我如何编写一个小jar文件给我的用户只需从URL获取一个jar文件(其中包含多个类)并运行它。如果最终用户在任何时候都没有在他的计算机上真正拥有jar,那将是很棒的。我这样做是一个小小的安全措施。

I've been searching for days but I have not found a clear answer. How would I go about writing a small jar file to give to my users that simply gets a jar file from a URL (with multiple classes in it) and run it. It would be great if the end user never actually has the jar on his computer at anytime. I am doing this as a small security measure.

推荐答案

另一种选择是加密你的JAR文件并编写一个自定义的类加载器在客户端计算机上即时解密它。这不会阻止高级用户将调试器连接到JVM并检查字节代码,但它会阻止典型用户访问您的代码。

Another option would be to encrypt your JAR file and write a custom class loader that decrypts it on the fly on client machines. This won't prevent a power user from attaching a debugger to the JVM and examining your byte code, but it prevents the typical user from having access to your code.

这篇关于从URL加载jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆