Java/CVM - Boot Class Path

浪子不回头ぞ 提交于 2019-12-11 19:28:20

问题


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

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?

thanks a million guys

Elie


回答1:


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

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.

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.

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



来源:https://stackoverflow.com/questions/8310083/java-cvm-boot-class-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!