Java/CVM - Boot Class Path

elie picture elie · Nov 29, 2011 · Viewed 8k times · Source

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

Answer

socha23 picture socha23 · Nov 29, 2011

-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.