简体   繁体   中英

Using python code within Java (Jython) problems

I'm trying to run some python code in real time (as my java code is running) but I keep running into the error below:

SyntaxError: ("mismatched input '.' expecting NEWLINE", ('<>duplicatetesting.py', 11, 43, 'from Python import DuplicateDefectDetection.java\\n'))

<> --> the text in here is the path to my python code I've pretty much replicated what was outlined in Accessing Jython from Java Without Using jythonc .

Code:

public interface DuplicateDefectDetection {
public String getRecallRate();
public void setBugsFile(String BugsFile);
public void setDuplicatesFile(String GD);
public void setNumTopics(int numTopics);
public void setCutOff(int cutOff);
public void setRecall(boolean recall);
public void runDuplicateTesting();
}

Shouldn't that import be:

from Python import DuplicateDefectDetection

I mean, without the .java part. Also, it has to be a compiled class, accessible from the classpath.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM