我创建简单的 java 类并将其导出到 jar:
package test;
public class Test {
public Test() {
// TODO Auto-generated constructor stub
}
}
jar文件添加到Pentaho的lib文件夹中(有很多jar文件) 下一步我想在 Pentaho 数据集成中使用我的类,所以我创建了用户定义的 Java 类:
public boolean processRow(StepMetaInterface smi, StepDataInterface sdi) throws KettleException
{
test.Test t = new test.Test();
return true;
}
当我点击测试类时,我得到以下信息:
Line 3, Column 12: Class "test.Test" not found
所以我有一个疑问:错在哪里,为什么找不到类?
最佳答案
- 尝试检查
/design-tools/data-integration/launcher
文件夹中的 launcher.property 文件。确保类路径和库定义了 jar 的路径。由于您已将 JAR 文件放在lib
文件夹中,因此请查找它。
- 编辑后重新启动 Spoon,它会正常工作。
我已将代码放在 libext
文件夹中,因此我已将 :../libext
添加到类路径和库中。下面是代码片段:
如果仍然报错,请尝试再次检查 Java 代码。我认为那里可能出了问题。
还在 here 中记录了以上内容.
希望对您有所帮助:)
关于java - Pentaho 数据集成用户定义的 Java 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28371182/