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 <gentoo-user+bounces-102392-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1N1upa-0002t7-BB
	for garchives@archives.gentoo.org; Sun, 25 Oct 2009 04:35:50 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 05CFEE0799;
	Sun, 25 Oct 2009 04:35:49 +0000 (UTC)
Received: from mail-px0-f200.google.com (mail-px0-f200.google.com [209.85.216.200])
	by pigeon.gentoo.org (Postfix) with ESMTP id CC822E0799
	for <gentoo-user@lists.gentoo.org>; Sun, 25 Oct 2009 04:35:48 +0000 (UTC)
Received: by pxi38 with SMTP id 38so2034790pxi.10
        for <gentoo-user@lists.gentoo.org>; Sat, 24 Oct 2009 21:35:48 -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
         :content-transfer-encoding;
        bh=2RRJZouQmVeG1H7NpZcObF4kNjEujNXA2x5QmIaUJzo=;
        b=dotqJRiDHOX/bGs7FGk7vwLoTg+DXp67i4ZFTkQ6YgRzqztZwbzPbyXWLlk8fY1fN4
         SFpEgwo/Zk1Bat9Gik3pTCdtrbxS6npT+gJ1Kd7xGJHk4pp9eMKr5ERmkh6bxErcIOa9
         +p9UV3Okbkd44B6FFkAt3VPKNqsiYxPy7cRnA=
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:content-transfer-encoding;
        b=W/p1xDQ17L3kJjBq2Ndfg5s9GO0mobY9ZKDFJz+raybSysf1g6xjm9tv146n1QJ/VM
         Lo1bK7AU0vK4uEKxuwn/Z2YGuOgfq2uEEJmZdUa4Hz0XEfi6kyI0z2BKxcnkVmFWk47I
         DZrDyDud+fNx1mEIKOLWC17iWzYbaar18tfRQ=
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Received: by 10.115.67.24 with SMTP id u24mr4595825wak.59.1256445348299; Sat, 
	24 Oct 2009 21:35:48 -0700 (PDT)
In-Reply-To: <4AE3A011.4030309@gmail.com>
References: <49bf44f10910241312i703d447fj3ffa1156b1bcf074@mail.gmail.com>
	 <4AE3A011.4030309@gmail.com>
Date: Sat, 24 Oct 2009 21:35:48 -0700
Message-ID: <49bf44f10910242135g3318bbe5w1ef9fd2e010bbc95@mail.gmail.com>
Subject: Re: [gentoo-user] ebuild help: java main class?
From: Grant <emailgrant@gmail.com>
To: gentoo-user@lists.gentoo.org
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Archives-Salt: 83346725-cd88-4c6e-8165-86b2e315cf1c
X-Archives-Hash: b60c89d3a93d4b895da89cd71f6ee12f

>> I'm trying to fix up the JAlbum ebuild:
>>
>> http://bugs.gentoo.org/show_bug.cgi?id=3D128356
>>
>> and get it to use java-pkg-2. =A0Here's what I have so far:
>>
>> inherit java-pkg-2 eutils
>>
>> S=3D"${WORKDIR}/Jalbum"
>> DESCRIPTION=3D"Web photo album generator"
>> HOMEPAGE=3D"http://jalbum.net/"
>> SRC_URI=3D"http://jalbum.net/download/Jalbum${PV}.zip"
>>
>> LICENSE=3D"as-is"
>> SLOT=3D"0"
>> KEYWORDS=3D"x86"
>> IUSE=3D""
>>
>> DEPEND=3D">=3Dvirtual/jre-1.5"
>> RDEPEND=3D"${DEPEND}"
>>
>> src_install() {
>> =A0 =A0java-pkg_dojar JAlbum.jar
>> =A0 =A0java-pkg_dolauncher jalbum \
>> =A0 =A0 =A0 =A0--jar JAlbum.jar \
>> =A0 =A0 =A0 =A0--java_args -Xmx400M
>>
>> =A0 =A0local dest=3D/usr/lib/${PN}
>> =A0 =A0dodir ${dest}
>> =A0 =A0cp -R ${S}/* ${D}/${dest} || die "Install failed"
>>
>> =A0 =A0doicon ${FILESDIR}/Jalbum-icon.png
>> =A0 =A0make_desktop_entry ${PN}
>> }
>>
>> It executes just fine, but I get:
>>
>> $ jalbum
>> Error: se.datadosen.jalbum.JAlbum
>> java.lang.ClassNotFoundException: se.datadosen.jalbum.JAlbum
>> =A0 =A0 =A0 =A0at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>> =A0 =A0 =A0 =A0at java.security.AccessController.doPrivileged(Native Met=
hod)
>> =A0 =A0 =A0 =A0at java.net.URLClassLoader.findClass(URLClassLoader.java:=
188)
>> =A0 =A0 =A0 =A0at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
>> =A0 =A0 =A0 =A0at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
>> =A0 =A0 =A0 =A0at se.datadosen.jalbum.Main.main(Main.java:23)
>>
>> I was told I need to define the main class with --main. =A0Does 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 ove=
r
> 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 Jav=
a's
> ways don't mix that well with Gentoo's approaches, especially with compil=
ing
> 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=3D.:${CLASSPATH} foo.sh". With a little luck it
> might work as such, without the pain of making a proper ebuild for it.
>
> --
> Arttu V.

So 'emerge JAlbum' isn't feasible?

- Grant