Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ebuild help: java main class?
Date: Sat, 24 Oct 2009 20:24:16
Message-Id: 200910242223.09818.alan.mckinnon@gmail.com
In Reply to: [gentoo-user] ebuild help: java main class? by Grant
1 On Saturday 24 October 2009 22:12:22 Grant wrote:
2 > I'm trying to fix up the JAlbum ebuild:
3 >
4 > http://bugs.gentoo.org/show_bug.cgi?id=128356
5 >
6 > and get it to use java-pkg-2. Here's what I have so far:
7 >
8 > inherit java-pkg-2 eutils
9 >
10 > S="${WORKDIR}/Jalbum"
11 > DESCRIPTION="Web photo album generator"
12 > HOMEPAGE="http://jalbum.net/"
13 > SRC_URI="http://jalbum.net/download/Jalbum${PV}.zip"
14 >
15 > LICENSE="as-is"
16 > SLOT="0"
17 > KEYWORDS="x86"
18 > IUSE=""
19 >
20 > DEPEND=">=virtual/jre-1.5"
21 > RDEPEND="${DEPEND}"
22 >
23 > src_install() {
24 > java-pkg_dojar JAlbum.jar
25 > java-pkg_dolauncher jalbum \
26 > --jar JAlbum.jar \
27 > --java_args -Xmx400M
28 >
29 > local dest=/usr/lib/${PN}
30 > dodir ${dest}
31 > cp -R ${S}/* ${D}/${dest} || die "Install failed"
32 >
33 > doicon ${FILESDIR}/Jalbum-icon.png
34 > make_desktop_entry ${PN}
35 > }
36 >
37 > It executes just fine, but I get:
38 >
39 > $ jalbum
40 > Error: se.datadosen.jalbum.JAlbum
41 > java.lang.ClassNotFoundException: se.datadosen.jalbum.JAlbum
42 > at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
43 > at java.security.AccessController.doPrivileged(Native Method)
44 > at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
45 > at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
46 > at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
47 > at se.datadosen.jalbum.Main.main(Main.java:23)
48 >
49 > I was told I need to define the main class with --main. Does anyone
50 > know how to determine what the main class should be?
51
52
53 What's the line normally used to launch the app at runtime? That, together
54 with CLASSPATH will tell you what class should be executed as main()
55
56
57 --
58 alan dot mckinnon at gmail dot com

Replies

Subject Author
Re: [gentoo-user] ebuild help: java main class? Grant <emailgrant@×××××.com>