public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alan McKinnon <alan.mckinnon@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] ebuild help: java main class?
Date: Sat, 24 Oct 2009 23:12:43 +0200	[thread overview]
Message-ID: <200910242312.43760.alan.mckinnon@gmail.com> (raw)
In-Reply-To: <49bf44f10910241332s3206494cp7220dd77c254d95c@mail.gmail.com>

On Saturday 24 October 2009 22:32:18 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?
> >
> > 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.  It 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, and 
it's location is visible to the script. There's no path so I'm assuming the 
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?

p.s. I don't know how familiar you are with Java's start-up process and how it 
finds things and how you specify things to find. It's somewhat unusual and 
many traps exist for the unwary :-)

-- 
alan dot mckinnon at gmail dot com



  reply	other threads:[~2009-10-24 21:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-24 20:12 [gentoo-user] ebuild help: java main class? Grant
2009-10-24 20:23 ` Alan McKinnon
2009-10-24 20:32   ` Grant
2009-10-24 21:12     ` Alan McKinnon [this message]
2009-10-24 21:52       ` Grant
2009-10-25  0:47 ` Arttu V.
2009-10-25  4:35   ` Grant
2009-10-25 11:47     ` Arttu V.
2009-10-25 14:33       ` Grant
2009-10-25 15:02       ` Grant
2009-10-25 17:48         ` Arttu V.
2009-10-25 18:33           ` Grant
2009-10-25 22:21             ` Grant
2009-10-25 23:57               ` Grant
2009-10-25 11:55 ` Justin
2009-10-25 14:33   ` Grant
2009-10-25 16:34     ` Justin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200910242312.43760.alan.mckinnon@gmail.com \
    --to=alan.mckinnon@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox