hello friends; can anybody help me sove this problem??? I have a java class in netbeans :
/
* To change this template, choose Tools | Templates
* and open the template in the editor.
/
package stm;
import zemberek.morphology.apps.TurkishMorphParser;
import zemberek.morphology.parser.MorphParse;
import java.io.IOException;
import java.util.List;
/
* @author jeren
/
public class Stm {
TurkishMorphParser parser;
public Stm(TurkishMorphParser parser) { this.parser = parser; } public void do_stm(String word) { System.out.println("Word = " + word); List<MorphParse> parses = parser.parse(word); for (MorphParse parse : parses) { System.out.println(parse.getStems()); } } /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { // TODO code application logic here TurkishMorphParser parser = TurkishMorphParser.createWithDefaults(); new Stm(parser).do_stm("ankaraya"); }
}
and a python code:
import jpype
from jpype import *
import os
classpath = "/home/jeren/Desktop/Project/TweetParse/Parse_Tweets/stm/jars/antlr-4.2.2-complete.jar:/home/jeren/Desktop/Project/TweetParse/Parse_Tweets/stm/jars/guava-15.0.jar:/home/jeren/Desktop/Project/TweetParse/Parse_Tweets/stm/jars/zemberek-core-0.9.0.jar:/home/jeren/Desktop/Project/TweetParse/Parse_Tweets/stm/jars/zemberek-lm-0.9.0.jar:/home/jeren/Desktop/Project/TweetParse/Parse_Tweets/stm/jars/zemberek-morphology-0.9.0.jar:/home/jeren/Desktop/Project/TweetParse/Parse_Tweets/stm/jars/zemberek-tokenization-0.9.0-2.jar:/home/jeren/Desktop/Project/TweetParse/Parse_Tweets/stm/build/classes"
startJVM(getDefaultJVMPath(), "-ea", "-Djava.class.path=%s" %classpath)
A = JClass('stm.Stm')
a = cls()
jpype.shutdownJVM()
I get this error when I run aa.py:
Traceback (most recent call last):
File "aa.py", line 14, in <module>
A = JClass('stm.Stm')
File "/usr/lib/python2.7/dist-packages/jpype/_jclass.py", line 54, in JClass
raise _RUNTIMEEXCEPTION.PYEXC("Class %s not found" % name)
jpype._jexception.ExceptionPyRaisable: java.lang.Exception: Class stm.Stm not found
sorry for bold statements.. those are not part of codes .. I have made them as comments inside the code !
anybody????? :(
I solved it by changing the JDK I used from 1.6 to 1.7 ..
Last edit: Jeren 2014-05-12