jol-cli and external class path
Aleksey Shipilev
aleksey.shipilev at oracle.com
Wed May 13 12:21:51 UTC 2015
On 13.05.2015 12:13, Aleksey Shipilev wrote:
> On 05/13/2015 02:42 AM, Bernd Eckenfels wrote:
>> I noticed that on the JOL homepage the jol-cli samples all use the -jar
>> executable form. With this it is not possible to specify additional
>> classes on the class path.
>>
>> Is there a way to do it, or is it allowed/expected to use java -cp in
>> this case? Should this be documented?
>
> Yes, at the moment, that's the way you do it, classpath the JOL JAR, and
> explicitly enter the Main JOL method.
>
> There might be a better way, but I can't clearly see it now. We can
> probably accept our own classpath line and set up our own URLClassLoader
> to pull the selected classes from there, like:
>
> $ java -jar jol-cli.jar internals -cp myjar.jar:myjar2.jar test.MyClass
> $ java -jar jol-cli.jar internals -cp target/classes test.MyClass
Yes, this is it:
https://bugs.openjdk.java.net/browse/CODETOOLS-7901419
http://hg.openjdk.java.net/code-tools/jol/rev/23eb6c92ad4e
Bernd, can you build JOL from source and tell if that covers your
scenarios? General review is also appreciated. If everything is fine, we
can arrange the 0.3.3 release with this on-board.
Thanks,
-Aleksey.
More information about the jol-dev
mailing list