From owner-freebsd-java@FreeBSD.ORG Mon Sep 21 21:09:21 2009 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B3C81065670 for ; Mon, 21 Sep 2009 21:09:21 +0000 (UTC) (envelope-from grarpamp@gmail.com) Received: from mail-ew0-f208.google.com (mail-ew0-f208.google.com [209.85.219.208]) by mx1.freebsd.org (Postfix) with ESMTP id 0331A8FC0C for ; Mon, 21 Sep 2009 21:09:20 +0000 (UTC) Received: by ewy4 with SMTP id 4so2847503ewy.36 for ; Mon, 21 Sep 2009 14:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=xjri/s6eRX7iRUWuXjmrKn/XtdqYnewBa6N8Y0Dc9P8=; b=rkzsMQQ+E2WIg3UOo6vHUK43sz8dLUxqozavZx2QjH4KMk/b6Vm/SZk0LYUFC6Ds/q ptN5ZK0M67T7r5BSIxvJjGLRos2+h8mprkWexN15Gy9Y0E7REtypZzshOoD9yXw6dC0K 1I36Gd+Gu9O5per5fxdv1Xbh2isZ093SD7H+g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=t7St7fgXhwCQOKZT2TGtF8VypbEQuezgSWzhnSqhwdBeG0dJRAvWidWg1ySqpo1//t wEigmA0xg9UAj8ajuXUQbQUKoVWZ/5vzxxZpYBRC5wgxujajffyokfEiP3Wrhj3kCW5m lrUJMtplfJTZ0rYxEclz9hdKF4vKFbDM2fcW8= MIME-Version: 1.0 Received: by 10.210.84.10 with SMTP id h10mr255582ebb.70.1253567359680; Mon, 21 Sep 2009 14:09:19 -0700 (PDT) In-Reply-To: <200909211306.31039.pieter@degoeje.nl> References: <200909211306.31039.pieter@degoeje.nl> Date: Mon, 21 Sep 2009 17:09:19 -0400 Message-ID: From: grarpamp To: freebsd-java@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: java jar invocation X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 21:09:21 -0000 > 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.