From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1N1rGN-0006Ey-PY for garchives@archives.gentoo.org; Sun, 25 Oct 2009 00:47:16 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D6125E07EC; Sun, 25 Oct 2009 00:47:13 +0000 (UTC) Received: from mail-bw0-f215.google.com (mail-bw0-f215.google.com [209.85.218.215]) by pigeon.gentoo.org (Postfix) with ESMTP id 96B7EE07EC for ; Sun, 25 Oct 2009 00:47:13 +0000 (UTC) Received: by bwz7 with SMTP id 7so1514180bwz.26 for ; Sat, 24 Oct 2009 17:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=UPUHDtt1saobjhDjX5ga3IUAPO98IRCI9wfItyVFycg=; b=POGFx3eUlGFCwUUxAfnyY+DMhoKLIrflL+D02Hcb4Btpy8oC5Jfv0GdX26hq97PXWx C0owfkoira3gwpzTN2SZ/u4juKVNYDYIxZx+OZHX5GOYsrhbFiR/r3qbTAxej5M419Vh jK0MgvWUoqk8W/hIj0FisJEPsTa5CCGZnBZBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=WIitw7KGGQ6OmVqD9e0u2BNHRjiBQvfsVHn+h+LmTg5MEtIMvZsunnrhKfDmAra8Ze LpaI7PcSn3xHhBHs5vW6/Heok4pBZrV6lBUJZ249V5zVvXuG+chXPwuMr3pajVN7TKEL Ie0wPiyou7gwHpICZern8CooKmoukT/sGsFUQ= Received: by 10.204.7.92 with SMTP id c28mr1245769bkc.170.1256431632958; Sat, 24 Oct 2009 17:47:12 -0700 (PDT) Received: from ?192.168.0.45? (a91-156-147-230.elisa-laajakaista.fi [91.156.147.230]) by mx.google.com with ESMTPS id 19sm6787703fkr.23.2009.10.24.17.47.11 (version=SSLv3 cipher=RC4-MD5); Sat, 24 Oct 2009 17:47:12 -0700 (PDT) Message-ID: <4AE3A011.4030309@gmail.com> Date: Sun, 25 Oct 2009 03:47:13 +0300 From: "Arttu V." User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090825 SeaMonkey/1.1.18 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] ebuild help: java main class? References: <49bf44f10910241312i703d447fj3ffa1156b1bcf074@mail.gmail.com> In-Reply-To: <49bf44f10910241312i703d447fj3ffa1156b1bcf074@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Archives-Salt: 7ca67ae9-119f-4895-85e0-bf044cb71b4a X-Archives-Hash: 80023a60ac990709005f3a35844a0efa Grant wrote: > I'm trying to fix up the JAlbum ebuild: > > http://bugs.gentoo.org/show_bug.cgi?id=128356 > > and get it to use java-pkg-2. Here's what I have so far: > > inherit java-pkg-2 eutils > > S="${WORKDIR}/Jalbum" > DESCRIPTION="Web photo album generator" > HOMEPAGE="http://jalbum.net/" > SRC_URI="http://jalbum.net/download/Jalbum${PV}.zip" > > LICENSE="as-is" > SLOT="0" > KEYWORDS="x86" > IUSE="" > > DEPEND=">=virtual/jre-1.5" > RDEPEND="${DEPEND}" > > src_install() { > java-pkg_dojar JAlbum.jar > java-pkg_dolauncher jalbum \ > --jar JAlbum.jar \ > --java_args -Xmx400M > > local dest=/usr/lib/${PN} > dodir ${dest} > cp -R ${S}/* ${D}/${dest} || die "Install failed" > > doicon ${FILESDIR}/Jalbum-icon.png > make_desktop_entry ${PN} > } > > It executes just fine, but I get: > > $ jalbum > Error: se.datadosen.jalbum.JAlbum > java.lang.ClassNotFoundException: se.datadosen.jalbum.JAlbum > at java.net.URLClassLoader$1.run(URLClassLoader.java:200) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:188) > at java.lang.ClassLoader.loadClass(ClassLoader.java:307) > at java.lang.ClassLoader.loadClass(ClassLoader.java:252) > at se.datadosen.jalbum.Main.main(Main.java:23) > > I was told I need to define the main class with --main. Does anyone > know how to determine what the main class should be? No, it has clearly already loaded at least one class (last line of that stack trace reveals this), and is looking for some others needed by that class -- but the classloader fails to find them. JAlbum probably also has a Main-Class header defined in the jar's manifest, so this is likely to be just another classpath-related issue. But the ebuild you're pushing ... I think it would need some serious work for the installation part. I think it installs files in all wrong places, and thus Gentoo's Generation 2 java system cannot automatically add them to classpath. There is some advice on the issue in section 3, the Filesystem layout over here: http://www.gentoo.org/proj/en/java/java-devel.xml After trudging through that you might understand why Gentoo Java team has constantly several dev positions advertised on "help wanted". Some of Java's ways don't mix that well with Gentoo's approaches, especially with compiling and packaging (installations). If you are in a hurry of some sort, you might just try taking the jar, unpacking it into a subdir under your homedir, cd'ing in, and trying something like "CLASSPATH=.:${CLASSPATH} foo.sh". With a little luck it might work as such, without the pain of making a proper ebuild for it. -- Arttu V.