Java/CVM-引导类路径 [英] Java/CVM - Boot Class Path

查看:84
本文介绍了Java/CVM-引导类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发将DB用于嵌入式设备的Java应用程序(使用CDC Foundation 1.1和jsr 169). jsr169 jar文件应该由引导加载程序加载(而不是使用传统的-classpath选项)

I am developing an java application that uses a DB for an embedded device (using CDC Foundation 1.1 and jsr 169). the jsr169 jar file should be loaded by the boot strap loader (and not using the traditional -classpath option)

为了运行该应用程序,我正在使用以下命令

In order to run the application, I am using the following command

cvm -Xbootclasspath/a:/mylibs/jsr169.jar -cp $CLASSPATH -jar myapp.jar

但是我在某处读到-Xbootclasspath选项不是标准选项,使用它危险吗?如果是,我可以将jsr169.jar放在哪里,以便它可以由引导类加载器直接加载?

But I read somewhere that the option -Xbootclasspath is not standard, is it dangerous to use it? if yes, where can i put my jsr169.jar so it can loaded directly by the boot class loader?

感谢一百万个家伙

Elie

推荐答案

-Xbootclasspath不是标准的Java选项,因此不同供应商的JVM可能不支持它.

-Xbootclasspath isn't a standard java option, so JVMs by different vendors may not support it.

另一个危险在于,它可以用于覆盖JRE中的标准类-如果您的应用程序依赖于此类覆盖的类,则在不同的JVM或同一JVM的更新版本上运行时可能会遇到问题.

Another danger lies in the fact that it can be used to override standard classes from JRE - if your application depends on such overriden classes, you may have problems with running on different JVMs or even newer versions of the same JVM.

根据Java SE文档,重写标准类会破坏Java许可:根据.不过,我在CVM文档中没有看到这样的警告.

According to Java SE documentation, overriding standard classes breaks Java license: according to Oracle documentation, "Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license.". I don't see such warning in documentation for CVM, though.

由于CDC不包含JDBC类,所以我认为您很安全.

As CDC does not include JDBC classes, I guess you're safe.

这篇关于Java/CVM-引导类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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