On 2025-05-30, Earl Hood wrote:

> I recently came across the need to use the -cp launcher option instead of
> -lib as I needed to control which jars in a directory are loaded.  However,
> I noticed -cp is undocumented and only realized it existed by examining the
> Launcher.java source.

> Question: Will the -cp option continued to be supported even though it is
> undocumented?

Launcher was introduced ages ago and I don't really recall why -cp was
never documented. I can only guess here. In fact I just had to look at
the code to recall what it was doing.

It is kind of hard to explain the difference between -cp and -lib (no
difference at al for files).

I believe -cp really only exists as a way to send down CLASSPATH from
the wrapper script to the launcher. If you look at the commit that
introduced it[1] it was in order to fix a bug[2] against the way the
wrapper scripts treated CLASSPATH prior to the patch.

So we never really deemed it an official API - maybe.

Given the way we've tried to avoid breaking backwards compatibility in
the past I very much doubt, anybody will remove any command line option
from Launcher. The risk of breaking things for other people who read the
code - just like you did - would be too big.

Stefan

[1] 
https://github.com/apache/ant/commit/543344b83993d92a562a4db14717a1a8f27f499d

[2] https://bz.apache.org/bugzilla/show_bug.cgi?id=28046

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to