← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #225333]: Sikuli project import from Windows to Linux fails

 

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

    Status: Needs information => Open

Sunny gave more information on the question:
Hi RiaMan...

Please find the code below:(Its not in a proper state..)

public class SikuliDemo {

                        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 file for the specified desktop application
		App.open("/home/speedcam/sikulliTestImages/skype");

		try {
			Thread.sleep(1200);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		try {
			mScreen.type("/home/sikulliTestImages/SkypeName-1.png", "UserName");
			mScreen.type(Key.ENTER);
		} catch (FindFailed e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		try {
			Thread.sleep(300);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		try {
			mScreen.type("/home/sikulliTestImages/SkypePassWord.png", "Password");
			mScreen.type(Key.ENTER);
		} catch (FindFailed e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		try {
			Thread.sleep(300);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		try {
			mScreen.click("/home/sikulliTestImages/SignIn.png.");
		} catch (FindFailed e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		try {
			Thread.sleep(30000);
		} catch (InterruptedException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		try {
			mScreen.click("/home/sikulliTestImages/Recent-1.png.");
		} catch (FindFailed e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		try {
			mScreen.click("/home/sikulliTestImages/chandan.png");
		} catch (FindFailed e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


			try {				
			mScreen.type("/home/sikulliTestImages/Sendmessage.png","This is a virtual ping"); is                                              mScreen.type(Key.ENTER);
				Thread.sleep(300);
				browser.popup("Pingged Successfully !!");
			} catch (Exception e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			
		}
	}


This code runs properly on windows.
Now when i make an executable jar out of it()(i also package the required libraries as my Skili-Script jar is in my build path) and try and run it on linux machine its gives 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 com.sikuli.SikuliDemo.main(SikuliDemo.java:32)
	... 5 more

Please help me out with this..

Thanks RiaMan !!

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