Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 69573 invoked from network); 15 Jun 2009 14:40:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Jun 2009 14:40:12 -0000 Received: (qmail 6328 invoked by uid 500); 15 Jun 2009 14:40:17 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 6243 invoked by uid 500); 15 Jun 2009 14:40:17 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 6207 invoked by uid 99); 15 Jun 2009 14:40:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2009 14:40:17 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [165.230.166.135] (HELO grove.marine.rutgers.edu) (165.230.166.135) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Jun 2009 14:40:08 +0000 Received: from localhost (unknown [127.0.0.1]) by grove.marine.rutgers.edu (Postfix) with ESMTP id EBE012F831D for ; Mon, 15 Jun 2009 10:39:46 -0400 (EDT) X-Virus-Scanned: amavisd-new at grove.marine.rutgers.edu Received: from grove.marine.rutgers.edu ([127.0.0.1]) by localhost (grove.marine.rutgers.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KP7F1eN527LD for ; Mon, 15 Jun 2009 10:39:43 -0400 (EDT) Received: from bottle.marine.rutgers.edu (bottle.marine.rutgers.edu [192.168.10.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by grove.marine.rutgers.edu (Postfix) with ESMTP id B6BBC2F8308 for ; Mon, 15 Jun 2009 10:39:43 -0400 (EDT) Received: from [192.168.50.5] (stafford-lt.marine.rutgers.edu [192.168.50.5]) (authenticated bits=0) by bottle.marine.rutgers.edu (8.12.11.20060308/8.12.11) with ESMTP id n5FEdh2f032218 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 15 Jun 2009 10:39:43 -0400 Message-ID: <4A365D2D.4040107@marine.rutgers.edu> Date: Mon, 15 Jun 2009 10:39:41 -0400 From: "Wm.A.Stafford" Reply-To: stafford@marine.rutgers.edu Organization: Institute of Marine and Coastal Sciences User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) MIME-Version: 1.0 To: Commons Users List Subject: Re: Using apache.commons.cli with Java 1.4.2 References: <23962584.post@talk.nabble.com> <4A2FDCF9.10305@apache.org> <23970787.post@talk.nabble.com> <4A321077.70206@apache.org> <24035021.post@talk.nabble.com> In-Reply-To: <24035021.post@talk.nabble.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org I'm jumping in sort of late on this, but here goes. To locate local config issues do the following. Create a simple script, call it 'view_cpath.bat', to invoke your app and output the classpath before the line that calls your app. ------ begin script (windows batch file example): echo classpath=%classpath% java my.org.myapp %* ----- end script invoke your app with view_cpath.bat ... normal arg list ... With classpath in hand, check the following: 1. is the cli jar file explicitly named in the classpath? *.jar will not work. 2. is the jar file actually in the place where the classpath says it should be? Use dir or ls on classpath entries to be sure. 3. check for misspellings of the jar file name in classpath. The spelling is relative, obviously both classpath entry and actual jar file must be spelled the same. Commons jar files have lots of '-' and '.', it is easy to get them wrong. I've done it many, many times! This will find the problem is it is just local configuration. To make sure you are using the correct jar file do the following. use 'jar tvf commons-cli-1.1.jar' (from the directory that contain the jar file) to view the contents of the jar file. In the output you should see something like: 423 Wed Jul 04 19:48:06 EDT 2007 org/apache/commons/cli/CommandLineParser.class If you don't see this you have a bad/wrong jar file. Try downloading again. Hope this helps, -=beeky esharris wrote: > This the only message: > > Exception in thread "main" java.lang.NoClassDefFoundError: > org/apache/commons/cli/CommandLineParser. > > I only have 1.4.2 java on my machine. > > Earl > > Emmanuel Bourg-3 wrote: > >> esharris a écrit : >> >> >>> IMHO, NoClassDefFoundError is hard to debug. >>> >> Could you paste the full stack trace? Also, check that the code was >> compiled with -target 1.4 >> >> Emmanuel Bourg >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org >> For additional commands, e-mail: user-help@commons.apache.org >> >> >> >> > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org