zhoususheng / berkeleylm

Automatically exported from code.google.com/p/berkeleylm
1 stars 0 forks source link

Exception in thread "main" java.lang.NoClassDefFoundError: edu/berkeley/nlp/lm/io/MakeKneserNeyArpaFromText #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download berkeleylm-1.0.0 or berkeleylm-1.0b3
2. Run examples\make-kneserney-arpa-from-raw-text.sh without the -server option

What is the expected output? What do you see instead?
Generate the ngram arpa file

What version of the product are you using? On what operating system?
1.0.0 or 1.0b3

Message Error:
--------------
Exception in thread "main" java.lang.NoClassDefFoundError: 
edu/berkeley/nlp/lm/io/MakeKneserNeyArpaFromText
Caused by: java.lang.ClassNotFoundException: 
edu.berkeley.nlp.lm.io.MakeKneserNeyArpaFromText
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: 
edu.berkeley.nlp.lm.io.MakeKneserNeyArpaFromText.  Program will exit.

Original issue reported on code.google.com by Eng.Sa...@gmail.com on 19 Feb 2012 at 12:38

GoogleCodeExporter commented 8 years ago
Can you give me a few more details? Does it work with the -server option? Can 
you report the actual command you are using? 

Thanks,

Adam

Original comment by adpa...@gmail.com on 19 Feb 2012 at 5:45

GoogleCodeExporter commented 8 years ago
No more details. I tried to download both of the stated versions and generate 
ngrams for raw text file using your example, but it didn't work.

The command is:

java -ea -mx1000m -cp ../src edu.berkeley.nlp.lm.io.MakeKneserNeyArpaFromText 5 
kneserNeyFromText.arpa ../test/edu/berkeley/nlp/lm/io/big_test.txt

Please let me know if you need more info.

Original comment by Eng.Sa...@gmail.com on 19 Feb 2012 at 6:09

GoogleCodeExporter commented 8 years ago
Does it work with the -server option? And did you first run the build script?

I'll have a chance to test things out soon, but am away from my home computer 
right now. 

Original comment by adpa...@gmail.com on 19 Feb 2012 at 6:14

GoogleCodeExporter commented 8 years ago
No it doesn't and I didn't run the build script. Do I have too?

The code I downloaded already has the JAR files and no need to re-build the src.

Original comment by Eng.Sa...@gmail.com on 19 Feb 2012 at 6:52

GoogleCodeExporter commented 8 years ago
Yes, that script does assume you've run the build. You could change the 
classpath (-cp) to point to the jar instead of the src directory. (The src 
directory would contain the compiled .class files if you ran the script).

Sorry for the confusion,

Adam

Original comment by adpa...@gmail.com on 19 Feb 2012 at 7:55

GoogleCodeExporter commented 8 years ago
Thanks. Problem has been resolved.

Sadek

Original comment by Eng.Sa...@gmail.com on 20 Feb 2012 at 6:39