如何确定 Java 应用程序的最低 JRE 版本和系统要求
我已经使用 Eclipse IDE 用 Java 编写了一个应用程序,现在我需要知道运行该应用程序所需的最低 JRE 版本!我知道某些方法仅在以后的 JRE 下可用,但我想知道找出应用程序的最高要求的最简单方法是什么,因此任何建议将不胜感激......
此外,当我谈论要求主题时,我将不胜感激任何建议或方法来确定我的软件的最低系统要求 - 即最小 RAM 量......
提前致谢
I have written an application in Java using Eclipse IDE and I now need to know the minimum JRE version that is required to run the application! I know that certain methods are only available under later JREs, but I was wondering what the easiest way to find out the highest requirement of my application would be, so any suggestions would be appreciated...
Also whilst I am on the topic of requirements, I would appreciate any advice or methods for determining the minimum system requirements for my software in general - i.e minimum amount of RAM...
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就 RAM 而言,这很简单。当 JVM 启动时,它会设置一个“最大”RAM 量(我相信默认值可能是 128MB),这是一个硬性限制,您的应用程序不能超过它而不崩溃。随着时间的推移分析您的应用程序,调整 JVM 上的内存设置,并找出您的应用程序运行 (a) 具有可接受的性能和 (b) 不引发 < 的情况所需的最小 RAM 量。 a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/OutOfMemoryError.html" rel="noreferrer">OutOfMemoryError,就完成了。
参考:如何配置 JVM 选项和内存?
对于其他要求例如 CPU 要求,事情变得有点模糊。有很多 CPU,给定系统产生的吞吐量不仅取决于 CPU 速度,还取决于硬盘驱动器的速度、系统中安装的 RAM 量、网络接口的速度(如果您正在编写网络应用程序),以及其他事情。对于诸如此类的要求,您只需在各种系统上进行测试,然后在某处划一条线,然后说:“如果您拥有至少与 X、Y 一样强大的硬件,那么您可以期望获得可接受的性能,Z”。
您可以做的另一件事是构建基准测试或某种性能日志记录,并将性能数据发送回给您。很多应用程序都这样做。你知道“我们可以将匿名使用数据发送回母舰吗?”您在安装某些软件时遇到的问题?这些数据中常见的是特定于系统的详细信息,例如 RAM、CPU、硬盘驱动器型号和其他硬件详细信息(您确定与应用程序相关的任何数据)以及性能日志记录数据。通过采用这种方法,您可以获得来自许多不同系统配置的大量性能数据,而无需内部拥有大量不同配置的机器。
您可以对程序崩溃和错误执行相同的操作 - 将堆栈跟踪、系统信息和其他相关数据转储到发送回给您的日志文件中 - 但当然,只有当您的用户说它是好的将该数据发送回给您。
As far as RAM, that's easy. When the JVM starts it sets a 'maximum' amount of RAM (I believe the default may be 128MB), and that's a hard limit that your application cannot exceed without crashing. Profile your app over time, tweaking the memory settings on the JVM, and find out what the minimum amount of RAM is that you'll need for your app to run both (a) with acceptable performance, and (b) without throwing an OutOfMemoryError, and you're done.
Ref: How to configure JVM options and memory?
For other requirements such as CPU req., things get a little fuzzier. There are a lot of CPUs out there, and the throughput that a given system produces can vary not just based on CPU speed, but the speed of the hard drive, the amount of RAM installed in the system, the speed of the network interface (if you're writing a network app), and other things. For requirements such as that, you'll want to just test it on a variety of systems and sort of draw a line somewhere, and say, "You can expect acceptable performance if you have hardware that is at least as powerful as X, Y, Z".
The other thing you could do is build in a benchmark, or some kind of performance logging, and have that performance data sent back to you. Lots of apps do this. You know that "May we send anonymous usage data back to the mothership?" question you get when installing some software? Well, common among that data are system-specific details such as RAM, CPU, hard drive model, and other hardware details (whatever data you determine is relevant to your app), along with performance logging data. By taking that kind of approach, what you get is a lot of performance data from lots of different system configurations without needing to have a huge number of differently configured machines in-house.
You can do the same thing for program crashes and bugs - have the stack traces, system info, and other relevant data dumped to a log file that is sent back to you - but of course, only if your users have said it's okay to send that data back to you.