#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    69
    Rep Power
    12

    importing classes


    i am using j2sdk1.4.1_02 with jcreator and i need to import different classes e.g import gnu.regexp.*; // Regular expression classes

    i get this error
    C:\Program Files\Xinox Software\JCreator LE\MyProjects\Test.java:3: package gnu.regexp does not exist
    import gnu.regexp.*; // Regular expression classes
    ^
    1 error


    where should i go to get this package and into which directory and folder should i place it.


    Any help given much appreciated.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Bucharest, Romania
    Posts
    70
    Rep Power
    12
    try
    www.cacas.org/java/gnu/regexp
    download the package (I think it's a unix tarball, but your everyday winzip should do the trick)
    There's a readme in the package, I presume it will tell you to add a .jar file to your classpath (the easyest way to do it is to copy it to a directory - maybe <your_java_home>\jre\lib/ext), but I'm sure you'll read it yourself
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2003
    Location
    Guelph
    Posts
    16
    Rep Power
    0
    My recommendation is to use the regex library provided by Java. It is called regex and is stored in the util pacakge, so just use "import java.util.regex". You can find the api at http://java.sun.com/j2se/1.4.1/docs/api and read about it at http://developer.java.sun.com/develo...ses/1.4regex/. Just make sure you are using Java 1.4 or higher, because regex is not supported in any lower versions.

IMN logo majestic logo threadwatch logo seochat tools logo