Results 1 to 2 of 2
  1. #1
    TeFa is offline Member
    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0

    Question Snowball Package doesn't work when exported to jar file

    Hello,

    This problem is really driving me crazy,

    TO ANSWER MOST OF WHAT PEOPLE THINK: YES I ADDED snowball.jar TO THE CLASSPATH

    I have a simple main class that supposed to stem the word "going" to "go":
    Java Code:
        import weka.core.stemmers.SnowballStemmer;
    
        public class StemmerTest {
            public static void main(String[] args) {
    	        SnowballStemmer stemmer = new SnowballStemmer();
    	        stemmer.setStemmer("english");
    	        System.out.println(stemmer.stem("going"));
            }
        }
    First when I run it in eclipse it works and I get the following output:
    Java Code:
        Refreshing GOE props...
        ---Registering Weka Editors---
        Trying to add database driver (JDBC): RmiJdbc.RJDriver - Warning, not in CLASSPATH?
        Trying to add database driver (JDBC): jdbc.idbDriver - Warning, not in CLASSPATH?
        Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Warning, not in CLASSPATH?
        Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Warning, not in CLASSPATH?
        Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Warning, not in CLASSPATH?
        [KnowledgeFlow] Loading properties and plugins...
        [KnowledgeFlow] Initializing KF...
        go
    However when I export it as a runnable jar from eclipse "stem.jar" and execute it in the terminal "java -jar stem.jar" it doesn't work and I get the following output:
    Java Code:
        Refreshing GOE props...
        [KnowledgeFlow] Loading properties and plugins...
        [KnowledgeFlow] Initializing KF...
        Stemmer 'porter' unknown!
        Stemmer 'english' unknown!
        going
    I have no idea why the snowball.jar is not recognized in the exported jar ...
    Although both weka.jar and snowball.jar are included in the exported jar. Here is the stem.jar file structure:
    Java Code:
      
        stem.jar
               |
               |---META-INF
               |---org
               |---StemmerTest.class
               |---snowball.jar
               |---weka.jar
    I would appreciate any help with the problem

    Thanks in Advance,
    TeFa

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,455
    Rep Power
    20

    Default Re: Snowball Package doesn't work when exported to jar file

    weka.jar and snowball.jar are included in the exported jar.
    Java doesn't support nested jar files.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 2
    Last Post: 03-26-2013, 07:07 PM
  2. I wonder why this doesn't work...
    By louboulos in forum New To Java
    Replies: 3
    Last Post: 05-13-2012, 05:59 PM
  3. Package Doesn't exist - Issue with import
    By Sagars in forum New To Java
    Replies: 4
    Last Post: 08-08-2011, 06:36 PM
  4. Jar doesn't work
    By mad72584 in forum New To Java
    Replies: 35
    Last Post: 08-07-2011, 06:22 PM
  5. Why doesn't this work?
    By Corder10 in forum New To Java
    Replies: 1
    Last Post: 07-04-2009, 11:33 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •