From richarddavis@example.net  Fri Jun 30 05:41:17 2000
Return-Path: <richarddavis@example.net>
Mailing-List: contact richarddavis@example.net; run by ezmlm
Delivered-To: mailing list richarddavis@example.net
Received: (qmail 5003 invoked from network); 30 Jun 2000 05:41:17 -0000
Received: from gtei1.bellatlantic.net (83.161.120.155)
  by locus.apache.org with SMTP; 30 Jun 2000 05:41:17 -0000
Received: from bellatlantic.net (adsl-141-150-42-46.nnj.adsl.bellatlantic.net [83.161.120.155])
	by gtei1.bellatlantic.net (8.9.1/8.9.1) with ESMTP id BAA22865
	for <richarddavis@example.net>; Fri, 30 Jun 2000 01:41:10 -0400 (EDT)
Sender: richarddavis@example.net
Message-ID: <richarddavis@example.net>
Date: Fri, 30 Jun 2000 01:41:16 -0400
From: jtnews <richarddavis@example.net>
X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.16-3 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: richarddavis@example.net
Subject: no class def found when using regexp
Content-Type: multipart/alternative;
 boundary="------------CE873AE94C862B964192EB8D"
X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N


--------------CE873AE94C862B964192EB8D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I'm having problems. I'm not sure why...if someone can give me a
clue.....

first I built the jar file with

export JAVA_HOME=/usr/java/jdk1.3 && sh build-regexp.sh

Then I compiled the following simple test program....

import org.apache.regexp.*;

class RegexTest {
    static void main(String [] args) throws Exception {
        int i = 0;
        String regex = args[i++];
 for (;i < args.length; ++i) {
     String string = args[i];
            System.out.print("RE(\"" + regex + "\").match(\"" +
                      string + "\")=");
            RE r = new RE(regex);
            if (r.match(string))
  System.out.println("true");
            else
                System.out.println("false");
        }
    }
}

Then I compiled with......

javac -g -O -classpath .:/sw/java/lib/jakarta-regexp-1.1.jar
RegexTest.java

Then I ran with....

export LD_LIBRARY_PATH=.:/sw/gcc/2.95.2/lib && java RegexTest "aa*.*"
"alpha"

and got....


RE("aa*.*").match("alpha")=Exception in thread "main"
java.lang.NoClassDefFoundError: org/apache/regexp/RE
 at RegexTest.main(RegexTest.java:11)

Can someone send me a small example?
Thanks.


--------------CE873AE94C862B964192EB8D
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I'm having problems. I'm not sure why...if someone can give me a clue.....
<p>first I built the jar file with
<p>export JAVA_HOME=/usr/java/jdk1.3 &amp;&amp; sh build-regexp.sh
<p>Then I compiled the following simple test program....
<p>import org.apache.regexp.*;
<p>class RegexTest {
<br>&nbsp;&nbsp;&nbsp; static void main(String [] args) throws Exception
{
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int i = 0;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String regex = args[i++];
<br>&nbsp;for (;i &lt; args.length; ++i) {
<br>&nbsp;&nbsp;&nbsp;&nbsp; String string = args[i];
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.out.print("RE(\"" + regex + "\").match(\"" +
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
string + "\")=");
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RE r = new RE(regex);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
if (r.match(string))
<br>&nbsp; System.out.println("true");
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
else
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.out.println("false");
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
<br>&nbsp;&nbsp;&nbsp; }
<br>}
<p>Then I compiled with......<tt></tt>
<p><tt>javac -g -O -classpath .:/sw/java/lib/jakarta-regexp-1.1.jar RegexTest.java</tt><tt></tt>
<p><tt>Then I ran with....</tt><tt></tt>
<p><tt>export LD_LIBRARY_PATH=.:/sw/gcc/2.95.2/lib &amp;&amp; java RegexTest
"aa*.*" "alpha"</tt><tt></tt>
<p><tt>and got....</tt>
<br><tt></tt>&nbsp;<tt></tt>
<p><tt>RE("aa*.*").match("alpha")=Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/regexp/RE</tt>
<br><tt>&nbsp;at RegexTest.main(RegexTest.java:11)</tt>
<p>Can someone send me a small example?
<br>Thanks.
<br>&nbsp;</html>

--------------CE873AE94C862B964192EB8D--


From richarddavis@example.net  Fri Jun 30 08:54:10 2000
Return-Path: <richarddavis@example.net>
Mailing-List: contact richarddavis@example.net; run by ezmlm
Delivered-To: mailing list richarddavis@example.net
Received: (qmail 88072 invoked from network); 30 Jun 2000 08:54:10 -0000
Received: from mail.clearink.com (HELO clearink.com) (83.161.120.155)
  by locus.apache.org with SMTP; 30 Jun 2000 08:54:10 -0000
Received: from [83.161.120.155] ([83.161.120.155])
	by clearink.com (8.10.2/8.10.2) with ESMTP id e5U8rwe16856
	for <richarddavis@example.net>; Fri, 30 Jun 2000 01:53:58 -0700
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022
Date: Fri, 30 Jun 2000 01:54:06 -0700
Subject: Re: no class def found when using regexp
From: Jon Stevens <richarddavis@example.net>
To: <richarddavis@example.net>
Message-ID: <richarddavis@example.net>
In-Reply-To: <richarddavis@example.net>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N

on 6/29/2000 10:41 PM, "jtnews" <richarddavis@example.net> wrote:

> export LD_LIBRARY_PATH=.:/sw/gcc/2.95.2/lib && java RegexTest "aa*.*" "alpha"
> 
> and got.... 
> 
> 
> RE("aa*.*").match("alpha")=Exception in thread "main"
> java.lang.NoClassDefFoundError: org/apache/regexp/RE
> at RegexTest.main(RegexTest.java:11)
> 
> Can someone send me a small example?

Why are you putting gcc into your LD_LIB_PATH? You need to put the
jakarta-regexp-1.1.jar into your CLASSPATH.

-jon


From richarddavis@example.net  Fri Jun 30 08:57:26 2000
Return-Path: <richarddavis@example.net>
Mailing-List: contact richarddavis@example.net; run by ezmlm
Delivered-To: mailing list richarddavis@example.net
Received: (qmail 89180 invoked from network); 30 Jun 2000 08:57:26 -0000
Received: from gtei1.bellatlantic.net (83.161.120.155)
  by locus.apache.org with SMTP; 30 Jun 2000 08:57:26 -0000
Received: from bellatlantic.net (adsl-141-150-42-46.nnj.adsl.bellatlantic.net [83.161.120.155])
	by gtei1.bellatlantic.net (8.9.1/8.9.1) with ESMTP id EAA06830
	for <richarddavis@example.net>; Fri, 30 Jun 2000 04:57:20 -0400 (EDT)
Sender: richarddavis@example.net
Message-ID: <richarddavis@example.net>
Date: Fri, 30 Jun 2000 04:57:24 -0400
From: jtnews <richarddavis@example.net>
X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.16-3 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: richarddavis@example.net
Subject: Re: no class def found when using regexp
References: <richarddavis@example.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N

The LD_LIBRARY_PATH is there to load a shared library from a
JNI. javac -classpath .... is supposed to take care of the classpath
issue.  I tried CLASSPATH too but that didn't work either.


Jon Stevens wrote:

> on 6/29/2000 10:41 PM, "jtnews" <richarddavis@example.net> wrote:
>
> > export LD_LIBRARY_PATH=.:/sw/gcc/2.95.2/lib && java RegexTest "aa*.*" "alpha"
> >
> > and got....
> >
> >
> > RE("aa*.*").match("alpha")=Exception in thread "main"
> > java.lang.NoClassDefFoundError: org/apache/regexp/RE
> > at RegexTest.main(RegexTest.java:11)
> >
> > Can someone send me a small example?
>
> Why are you putting gcc into your LD_LIB_PATH? You need to put the
> jakarta-regexp-1.1.jar into your CLASSPATH.
>
> -jon


From richarddavis@example.net  Fri Jun 30 09:08:51 2000
Return-Path: <richarddavis@example.net>
Mailing-List: contact richarddavis@example.net; run by ezmlm
Delivered-To: mailing list richarddavis@example.net
Received: (qmail 93913 invoked from network); 30 Jun 2000 09:08:51 -0000
Received: from mail.clearink.com (HELO clearink.com) (83.161.120.155)
  by locus.apache.org with SMTP; 30 Jun 2000 09:08:51 -0000
Received: from [83.161.120.155] ([83.161.120.155])
	by clearink.com (8.10.2/8.10.2) with ESMTP id e5U98he17130
	for <richarddavis@example.net>; Fri, 30 Jun 2000 02:08:43 -0700
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022
Date: Fri, 30 Jun 2000 02:08:50 -0700
Subject: Re: no class def found when using regexp
From: Jon Stevens <richarddavis@example.net>
To: <richarddavis@example.net>
Message-ID: <richarddavis@example.net>
In-Reply-To: <richarddavis@example.net>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N

on 6/30/2000 1:57 AM, "jtnews" <richarddavis@example.net> wrote:

> The LD_LIBRARY_PATH is there to load a shared library from a
> JNI. javac -classpath .... is supposed to take care of the classpath
> issue.  I tried CLASSPATH too but that didn't work either.

no. javac just is for compiling. you still need to put your .jar's into your
execution classpath. java doesn't static compile stuff.

-jon


From richarddavis@example.net  Fri Jun 30 09:29:45 2000
Return-Path: <richarddavis@example.net>
Mailing-List: contact richarddavis@example.net; run by ezmlm
Delivered-To: mailing list richarddavis@example.net
Received: (qmail 4878 invoked from network); 30 Jun 2000 09:29:45 -0000
Received: from gtei1.bellatlantic.net (83.161.120.155)
  by locus.apache.org with SMTP; 30 Jun 2000 09:29:44 -0000
Received: from bellatlantic.net (adsl-141-150-42-46.nnj.adsl.bellatlantic.net [83.161.120.155])
	by gtei1.bellatlantic.net (8.9.1/8.9.1) with ESMTP id FAA09360
	for <richarddavis@example.net>; Fri, 30 Jun 2000 05:29:30 -0400 (EDT)
Sender: richarddavis@example.net
Message-ID: <richarddavis@example.net>
Date: Fri, 30 Jun 2000 05:29:27 -0400
From: jtnews <richarddavis@example.net>
X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.16-3 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: richarddavis@example.net
Subject: Re: no class def found when using regexp
References: <richarddavis@example.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N

Ok, I know what I did wrong, I have to specify both -classpath on the compile line
AND
CLASSPATH when I run java.  I thought it was one or the other, but you have to do
both.

Thanks!

Jon Stevens wrote:

> on 6/29/2000 10:41 PM, "jtnews" <richarddavis@example.net> wrote:
>
> > export LD_LIBRARY_PATH=.:/sw/gcc/2.95.2/lib && java RegexTest "aa*.*" "alpha"
> >
> > and got....
> >
> >
> > RE("aa*.*").match("alpha")=Exception in thread "main"
> > java.lang.NoClassDefFoundError: org/apache/regexp/RE
> > at RegexTest.main(RegexTest.java:11)
> >
> > Can someone send me a small example?
>
> Why are you putting gcc into your LD_LIB_PATH? You need to put the
> jakarta-regexp-1.1.jar into your CLASSPATH.
>
> -jon



{'source': 'Apache Software Foundation Public Mail Archives'}