pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: How is apache-ant supposed to work?



Hi,

Jonathan Perkin <jperkin%joyent.com@localhost> writes:

> While I work a lot on OpenJDK packages, I have no real idea how Java 
> programs are supposed to function.  I'm trying to run the AdoptOpenJDK 
> test suite against my updated joyent/openjdk11 package but none of the 
> ant packages work:
>
> 1.5.4:
>
>   $ pkg_add apache-ant-1.5.4nb2
>
>   $ pkg_info -qL apache-ant | grep jar$
>   /opt/local/lib/java/ant/ant.jar
>   /opt/local/lib/java/ant/optional.jar
>
>   $ ant
>   Error: Could not find or load main class org.apache.tools.ant.Main
>   Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.Main
>
>   + exec /opt/local/java/openjdk11/bin/java -classpath :/opt/local/lib/java/ant/lib/java/ant/ant.jar:/opt/local/lib/java/ant/lib/java/ant/optional.jar:/opt/local/lib/java/ant/lib/java/crimson.jar -Dant.home=/opt/local/lib/java/ant org.apache.tools.ant.Main
>
> 1.9.13:
>
>   $ pkg_add -U apache-ant-1.9.13
>
>   $ pkg_info -qL apache-ant | grep jar$
>   /opt/local/lib/java/ant/ant-antlr.jar
>   /opt/local/lib/java/ant/ant-apache-bcel.jar
>   [..lots more in the same directory..]
>
>   $ ant
>   Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
>   Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
>
>   + exec /opt/local/java/openjdk11/bin/java -classpath /opt/local/lib/java/ant/lib/java/ant/ant-launcher.jar -Dant.home=/opt/local/lib/java/ant -Dant.library.dir=/opt/local/lib/java/ant/lib/java/ant org.apache.tools.ant.launch.Launcher -cp ''
>
> 1.10.9:
>
>   $ pkg_add -U apache-ant-1.10.9
>
>   $ pkg_info -qL apache-ant | grep jar$
>   /opt/local/lib/java/ant/ant-antlr.jar
>   /opt/local/lib/java/ant/ant-apache-bcel.jar
>   [..lots more in the same directory..]
>
>   $ ant       
>   Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
>   Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.launch.Launcher
>
>   + exec /opt/local/java/openjdk11/bin/java -classpath /opt/local/lib/java/ant/lib/java/ant/ant-launcher.jar -Dant.home=/opt/local/lib/java/ant -Dant.library.dir=/opt/local/lib/java/ant/lib/java/ant org.apache.tools.ant.launch.Launcher -cp ''

My apache-ant-1.10.9 and openjdk11-1.11.0.10.9 under
NetBSD/amd64-current works for test suites from
https://github.com/AdoptOpenJDK/openjdk-systemtest .

However it requires two patches to start the tests at least.
And some tests fail under NetBSD/amd64-current.
It seems that the other tests require more patches to start or finish the tests.
And Some tests failed with class file version mismatches.
I have no idea about how to fix these mismatches.

Anyway simple build.xml outside pkgsrc works with apache-ant-1.10.9
for me. It is installed as /usr/pkg/bin/ant.

I think that your /opt/local/bin/ant shell script has bad ANT_HOME
and ANT_LIB variables.

Could you send me your /opt/local/bin/ant shell script file?

Thank you.

P.S.
I do not find any difference in their behavior under
NetBSD/amd64-current between openjdk8 and openjdk11 packages yet.
However apache-tomcat9 does not work with openjdk11.
I wish someone can find the critical difference for apache-tomcat9
under NetBSD/amd64-current.

> The classpath is clearly wrong in all of them, but presumably they work 
> fine in other situations otherwise more people would notice.
>
> Would appreciate clue from Java people on how we can fix this so that 
> "ant" works as expected for builds outside of pkgsrc, while not breaking 
> whatever the other ways of calling it are.
>
> On a related note, should we be looking at switching them to prefixed 
> installs and pkg_alternatives?
>
> Thanks,
>
> -- 
> Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com

-- 
Ryo ONODERA // ryo%tetera.org@localhost
PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Home | Main Index | Thread Index | Old Index