Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Sep 2009 17:09:19 -0400
From:      grarpamp <grarpamp@gmail.com>
To:        freebsd-java@freebsd.org
Subject:   Re: java jar invocation
Message-ID:  <d2e731a10909211409y61963fe6mb00df6c2a1a8c57@mail.gmail.com>
In-Reply-To: <200909211306.31039.pieter@degoeje.nl>
References:  <d2e731a10909202352g2b13f2e7q73e5a249022fd129@mail.gmail.com> <200909211306.31039.pieter@degoeje.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
> BTW, Azureus (Vuze) is also in ports. Also you might want to
> install java/jdk16 instead of diablo-jre16

I figure it's better for me to learn the hard way before trying
ports. The goal is openoffice. Yeah, hard :)

So I found the commons here and pulled the jar file out of it:
 http://apache.mirrors.redwire.net/commons/cli/binaries/commons-cli-1.2-bin.zip
 commons-cli-1.2.jar

Then ran this simple thing again:
 java -cp `pwd`/commons-cli-1.2.jar -jar `pwd`/Azureus4.2.0.8.jar

And I got the same error. But the access time on commons-cli-1.2.jar
wasn't bumped, so I ktrace'd it.
  5987 java     NAMI  "/.../commons-cli.jar"

Playing along and dropping the apparently unneeded -cp arg, I get:
 ln -s commons-cli-1.2.jar commons-cli.jar
 java -jar `pwd`/Azureus4.2.0.8.jar
  Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Layout

So after downloading and symlinking log4j, this simplification works:
 java -jar Azureus4.2.0.8.jar --ui console


The closest I can get so far to having the libs in one dir without
symlinks and calling the app from elsewhere is to hunt up Main-Class
in [Thanks AR]:
 unzip Azureus4.2.0.8.jar META-INF/MANIFEST.MF
then run:
 java -cp `pwd`/jarz/\*:`pwd`/Azureus4.2.0.8.jar
org.gudy.azureus2.ui.common.Main --ui console
or move azureus into jarz and run:
 java -cp `pwd`/jarz/\*
org.gudy.azureus2.ui.common.Main --ui console
or:
 java -cp jarz/\*:Azureus4.2.0.8.jar
org.gudy.azureus2.ui.common.Main --ui console


The -jar style of that does not work:
 java -cp jarz/\*:Azureus4.2.0.8.jar -jar Azureus4.2.0.8.jar
  Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/cli/ParseException

I was eventually hoping for something like:
 java -cp /usr/local/jarz -jar /usr/local/bin/app.jar


> you are now running a jre compiled for FreeBSD-7.0

Yes. Hopefully we'll have a current java from the foundation for
8.0 when it comes out.  And to keep current I want to figure out
how to build from Sun's java sources sometime. If that doesn't
work, I'll try ports.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d2e731a10909211409y61963fe6mb00df6c2a1a8c57>