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();
}
-
You cannot import directly a .java file. You need it compiled first and the resulting class filesomewhere accesible by python (eg.Java's classpath)Daniel Voina– Daniel Voina2012年01月24日 21:41:23 +00:00Commented Jan 24, 2012 at 21:41
1 Answer 1
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.
2 Comments
from fully.qualified.package import DuplicateDefectDetection