[jdom-interest] Batch File and Classpath

Patrick Dowler patrick.dowler at nrc-cnrc.gc.ca
Fri Aug 8 11:12:36 PDT 2003


On August 8, 2003 10:25, Alex Rosen wrote:
> The "-jar <jarname>" needs to be the last thing on the command line
> before the app args. Try
>
>     java -classpath jdom.jar -jar CampNotes.jar

It used to be the case that -jar overrides -classpath... might still be.

Better  option:

add

Class-Path: jdom.jar

to the manifest of CampNotes.jar, then just do "java -jar CampNotes.jar ..."


> Alex Rosen
> Novell, Inc.
>
> >>> "M Ghazi" <storm at storm.demon.co.uk> 8/8/2003 12:46:43 PM >>>
>
> Hi there
>
> I have a small JARed java application that uses the JDOM classes. I am
> using a Windows/DOS batch file to allow the users to double click and
> run the java application.
>
> The Following are all installed in the same directory :
>     * jdom.jar
>     * CampNotes.jar
>     * CampNotes.bat
>
> The batch file does the following command :
>     java -jar -classpath jdom.jar CampNotes.jar
>
> But I get the following exception
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/jdom/JDOMException
>         at mad.proj.campnotes.gui.NoteFrame.<init>(NoteFrame.java:67)
>         at mad.proj.campnotes.main.CampNotes.main(CampNotes.java:15)
>
> Any one have any ideas why the -classpath is not working? I have never
> had problems with it before, just with JDOM.
>
> Thanks in advance.
> ______________
> M Ghazi (Storm)
> storm at storm.demon.co.uk
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@you
> rhost.com

-- 
Patrick Dowler
Tel/Tél: (250) 363-6914                  | fax/télécopieur: (250) 363-0045
Canadian Astronomy Data Centre   | Centre canadien de donnees astronomiques
National Research Council Canada | Conseil national de recherches Canada
Government of Canada                  | Gouvernement du Canada
5071 West Saanich Road               | 5071, chemin West Saanich
Victoria, BC                                  | Victoria (C.-B.)




More information about the jdom-interest mailing list