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 1N1oXi-0007My-Jv for garchives@archives.gentoo.org; Sat, 24 Oct 2009 21:52:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7C0DCE0684; Sat, 24 Oct 2009 21:52:57 +0000 (UTC) Received: from mail-pz0-f174.google.com (mail-pz0-f174.google.com [209.85.222.174]) by pigeon.gentoo.org (Postfix) with ESMTP id 4A85BE0684 for ; Sat, 24 Oct 2009 21:52:57 +0000 (UTC) Received: by pzk4 with SMTP id 4so11477831pzk.32 for ; Sat, 24 Oct 2009 14:52:56 -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=7tcrsnwFvit0Bm1GVC6Z1wazxaUp8ZmgcjFs1HQDnhQ=; b=QlXajzwKrsLnAp1Q8EA2TGqNpFfHDr9JfoZIJnahK33NT7Dq8MR5ohXmjvfIyIkMwg kTakleHd4vfUFv/YX+9kHFevXSbKRewPFGT2GUAVrUUZPLWmT4SGj9PQK4APtbHoSKxM ozM6nFWsqcJp38hjwLJSmEffa8tQ44fey/8vg= 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=aS6yLOZkid0pQIZI66ffcFRF+D1dfaRYIeqiA+FP+awU6DcDs6lKvGBCv2iXves/Vs Y6EEsAbR/Yfmq79yzAmd81UPup5JgKL1IPQzFHFzsiYo8ZMGU6QYA8ZhDs2oFFwCTId5 Ps1V209Eu176kJxBKf1W3mo5Icbt+RMj13sjU= 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 Received: by 10.115.26.13 with SMTP id d13mr797480waj.210.1256421176886; Sat, 24 Oct 2009 14:52:56 -0700 (PDT) In-Reply-To: <200910242312.43760.alan.mckinnon@gmail.com> References: <49bf44f10910241312i703d447fj3ffa1156b1bcf074@mail.gmail.com> <200910242223.09818.alan.mckinnon@gmail.com> <49bf44f10910241332s3206494cp7220dd77c254d95c@mail.gmail.com> <200910242312.43760.alan.mckinnon@gmail.com> Date: Sat, 24 Oct 2009 14:52:56 -0700 Message-ID: <49bf44f10910241452s3520e9dfnc946ee28f361dcc0@mail.gmail.com> Subject: Re: [gentoo-user] ebuild help: java main class? From: Grant To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: d8b82b0e-fe1b-4c56-ba53-ac06189accc6 X-Archives-Hash: f04a211df830de8a74c9f5e4a26d0021 >> >> 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 =A0 java-pkg_dojar JAlbum.jar >> >> =A0 =A0 java-pkg_dolauncher jalbum \ >> >> =A0 =A0 =A0 =A0 --jar JAlbum.jar \ >> >> =A0 =A0 =A0 =A0 --java_args -Xmx400M >> >> >> >> =A0 =A0 local dest=3D/usr/lib/${PN} >> >> =A0 =A0 dodir ${dest} >> >> =A0 =A0 cp -R ${S}/* ${D}/${dest} || die "Install failed" >> >> >> >> =A0 =A0 doicon ${FILESDIR}/Jalbum-icon.png >> >> =A0 =A0 make_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 at java.net.URLClassLoader$1.run(URLClassLoader.java:200) >> >> =A0 =A0 =A0 at java.security.AccessController.doPrivileged(Native Met= hod) >> >> =A0 =A0 =A0 at java.net.URLClassLoader.findClass(URLClassLoader.java:= 188) >> >> =A0 =A0 =A0 at java.lang.ClassLoader.loadClass(ClassLoader.java:307) >> >> =A0 =A0 =A0 at java.lang.ClassLoader.loadClass(ClassLoader.java:252) >> >> =A0 =A0 =A0 at se.datadosen.jalbum.Main.main(Main.java:23) >> >> >> >> I was told I need to define the main class with --main. =A0Does anyon= e >> >> know how to determine what the main class should be? >> > >> > What's the line normally used to launch the app at runtime? That, >> > together with CLASSPATH will tell you what class should be executed as >> > main() >> >> There is a file called startjalbum.sh which is supposed to be used to >> start the program. =A0It contains: >> >> #!/bin/sh >> java -Xmx400M -jar JAlbum.jar >> >> Does that tell you anything? > > Yes, it does. There's a file called JAlbum.jar which contains the app, an= d > it's location is visible to the script. There's no path so I'm assuming t= he > file is in the current directory. > > A .jar is just a special kind of zip file (much like OOo files are). What= 's > inside it? # unzip JAlbum.jar Archive: JAlbum.jar creating: META-INF/ inflating: META-INF/MANIFEST.MF creating: se/ creating: se/datadosen/ creating: se/datadosen/jalbum/ inflating: se/datadosen/jalbum/AlbumBeanEvent.class inflating: se/datadosen/jalbum/AlbumBeanListener.class inflating: se/datadosen/jalbum/AlbumEngine.class inflating: se/datadosen/jalbum/Main$1.class inflating: se/datadosen/jalbum/Main.class inflating: se/datadosen/jalbum/MiniConfig.class inflating: se/datadosen/jalbum/OperationAbortedException.class creating: se/datadosen/tags/ inflating: se/datadosen/tags/ElementException.class > p.s. I don't know how familiar you are with Java's start-up process and h= ow it > finds things and how you specify things to find. It's somewhat unusual an= d > many traps exist for the unwary :-) I'm completely clueless with java. Thanks a lot for your help thus far. - Grant