Solution for CLASSPATH
- To: debian-java@lists.debian.org
- Subject: Solution for CLASSPATH
- From: Nicos Panayides <anarxia@gmx.net>
- Date: 19 Apr 2003 04:40:35 -0700
- Message-id: <1050752435.3178.18.camel@localhost>
Hi all, I figured a way to make the job of java packaging a bit easier. The current approach is to create wrapper scripts that define the classpath and call java with the name of class containing the main. The problem is with package A depending on libraries from package B which in turns depends on libraries from package C. Package A needs to be aware of that and include both in the classpath. My solution is to have a custom classloader that is aware of /usr/share/java and with the possibilty of additional repositories. So as long as everything is under /usr/share/java all java packages can find all classes without the need for symlinks and explicit listing of jars in the CLASSPATH. So to create a wrapper for a java package you would only need to have a script that calls I have created the classloader (extends java.net.URLClassLoader) and it works ok. deb-java is the wrapper script for the classloader. It sets the classpath only for the jar file with the classloader and does: java -Djava.system.class.loader=DebianClassLoader $@ Examples: CLASSPATH is not set. ant can be invoked with: deb-java org.apache.tools.ant.Main argouml can be invoked with deb-java org.argouml.application.Main Package with the classloader and the sources are at: http://anarxia.dyndns.org:2180/debian/pool/ What do you think? Nicos
Reply to:
- Follow-Ups:
- Re: Solution for CLASSPATH
- From: Mark Howard <mh344@cam.ac.uk>
- Re: Solution for CLASSPATH
- From: Arnaud Vandyck <arnaud.vandyck@ulg.ac.be>
- Re: Solution for CLASSPATH
- Prev by Date: Re: Swing and other free GUIs (KDE?)
- Next by Date: Updates to Debian Java FAQ
- Previous by thread: Re: no j2sdk1.3 for ppc?
- Next by thread: Re: Solution for CLASSPATH
- Index(es):