0
我是Jython和Java的初学者,我对如何在Eclipse中引入java类感到困惑。基本上试图从这个jython文档复制海滩部分。 http://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.htmlJython引入java模块Eclipse
所以我有相同的代码,从文档,我相信我的问题是关系到类路径,我不知道这意味着什么。这是否意味着我需要构建我的.jar文件,并且它必须与我的jython代码位于同一个目录中?
我收到“导入海滩”的未解析导入错误。
的Java
package jython_test;
public class Beach {
private String name;
private String city;
public Beach(String name, String city){
this.name = name;
this.city = city;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
}
的Jython
import Beach
beach = Beach("Cocoa Beach","Cocoa Beach")
beach.getName()
beach.getCity()
谢谢!