python - RobotFramework cannot import Java keyword library -


i did robot framework python examples pybot, , referenced .py files library files. folder structure used test/lib/mylib.py , test/test/mytest.robot, /test @ same level /src folder in project in eclipse.

i tried similar things java project using jython. have /test/test/mytest.robot imports library ../lib/mylib.java. tried importing file using ride, shows red text, meaning import failed. specific message using jybot on command line is:

"importing test library 'c:\users\cody\git\myproject\test\lib\mylib.java' failed: importerror: no module named mylib"   

i read might need add classpath, , think in order so, need make .jar file. i'd rather not if possible leave .java file. attempted add lib folder build path... mean added /test/lib folder "source folders on build path". exported darn thing jar , added library. done project properties in eclipse.

i'm pretty stuck... ideas how working?

java being compiled language, need compile java class before importing robotframework.

normally, eclipse you, , put resulting .class files inside bin repository. if not, can issue javac path/to/file.java command, , move resulting .class file want (somewhere referenced classpath.

from within .robot file, should have line library test/lib/mylib, without neither .java nor .class @ end.


Comments