← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #186933]: Will Java Sikuli Script developed in Windows will work on Linux and MAc

 

Question #186933 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/186933

Description changed to:
I am working on windows with sikuli and java. The same script is not working on Linux.I am automating a desktop app.
I have written small test code on windows using java to automate skype app.Its works fine on the windows machine.
I am using Eclipse.
Now i want to check the compatablity of Sikilu on a linux machine as my deployment server wil be on the linux machine and so the tests do need to pass on there also.
I have installed Sikuli on Ubuntu and i am able to open the IDE and take screen shots there.
I am aimporting the project as a executable file with the necessary code changes for ubuntu(i.e the location where skype is present on ubuntu)...but when i try to run the jar file file from ubuntu, i get the following error..

[error] Can't create OS Util: org.sikuli.script.LinuxUtil
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.NullPointerException
	at org.sikuli.script.App.open(App.java:73)
	at org.sikuli.script.App.open(App.java:24)
	at org.sikuli.script.SikuliScript.openApp(SikuliScript.java:50)
	at com.sikuli.SikuliDemo.main(SikuliDemo.java:35)
	... 5 more

Small piece of code is as below:

public static void main(String[] args) {

		Screen mScreen = new Screen();
		SikuliScript browser = null;

		try {
			browser = new SikuliScript();
		} catch (AWTException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		// Opening the .exe file for the specified desktop application
		browser.openApp("/home/sikulliTestImages/skype");
............................

I suspect the way i am trying to open the skype app(The last line of code) on the Ubuntu server is not proper and thats y i get the Null Pointer Exception.(Sry but i am a bit new to it..)
Is that the reason or something else..Please Suggest.

Thanks in Advance

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.