Import error in One-jar "No module named Sikuli"
Hi,
I am trying Sikulix for the first time to automate an application in my pc.
I tried to code in Jython in Eclipse IDE importing Sikulixapi.jar.
I have a simple practice code that identifies and click Start button and then open Arduino by double clicking on icon in Desktop.
I wished to try bundling it with one-jar using 'ant' tool as documented in https:/
I followed the same procedure mentioned in this page and I was able to get ant build a .jar successfully. But if I try to run it using java -jar builtjarfile.jar, I get many errors message from this line:
Caused by: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "__pyclasspath_
ImportError: No module named Sikuli
I tried to build the sample application in the github link above and I was able to get it working. It was able to import from apache poi libary in its /lib folder.
Here's my folder structure :
BuildingJar
---/java-src
--- main.java
---/lib
---/onejar-src (copied from github repo above)
---/src
--- __init__.py
--- arduino.png
--- starticon.png
---build.xml
This is the source of __init__.py : (This worked when it ran from Eclipse IDE - It was able to click start icon and then double click arduino icon in desktop)
#-*- coding: utf-8 -*-
import org.sikuli.
from Sikuli import * #This is line 3!
import os
import time
scr=Screen(0);
def main():
scr.
scr.
time.sleep(5);
This is the source of main.java inside java-src folder
import org.python.
import org.python.
public class Main {
public static void main(String[] args) throws PyException{
PythonInterpreter intrp = new PythonInterpret
intrp.exec("import learning");
intrp.
}
}
------
I have compared my code and setup with the example app from the github repo. While the app built with ant from this repo is able to generate a .jar which has the apache poi library in libs and get it working to generate sample spreadsheet in my desktop, I am unable to get sikulixapi.jar importing sikuli and get it working on my sample app.
Can you please help me with this?
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: