11

I've seen -Xbootclasspath/p:path being used for loading class dynamically can you please elaborate and explain by providing example.

Roman C
  • 49,761
  • 33
  • 66
  • 176
NEO
  • 161
  • 1
  • 3
  • 10
  • Start by reading the Oracle documentation; i.e. the manual page on the `java` command and the document it links to on how the classpath works. – Stephen C Nov 24 '13 at 12:59
  • 3
    @StephenC : I went through Oracle documentaion site but, it was quite unclear about the usage. Thats the reason of posting the question. – NEO Nov 24 '13 at 14:38

1 Answers1

17

go to your command line and type java -X, to see the options available, -Xbootclasspath followed by path to comma seperated lists of jar files specified to prepend these classes before the standard jre classes. A use would be if you want to add patches affecting core runtime libraries.

user3020494
  • 712
  • 6
  • 9
  • 2
    Doesn't -Xbootclasspath *replace* the standard boot classpath in its entirety? Why do you say that they are *prepended*? – Pacerier Aug 27 '14 at 00:57
  • 12
    Looks like you can replace, append or prepend based on how you use it: `-Xbootclasspath:bootclasspath` files are used in place of; `-Xbootclasspath/a:path` files are appended to; `-Xbootclasspath/p:path` files are added in front of... http://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html – pherris Feb 23 '15 at 17:19
  • 4
    Note the "comma separated lists" statement is wrong. Multiple jars on Xbootclasspath are separated the same way as for standard classpath - semicolon in Windows, colon in Linux. The `java -X` provides hint with correct separator on each platform. – Tomáš Záluský May 11 '18 at 08:12