pkgsrc-Users archive

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

How is apache-ant supposed to work?



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

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


Home | Main Index | Thread Index | Old Index