← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #181819]: Compile a new jar with foo method ?

 

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

    Status: Answered => Open

Joe List is still having a problem:
Hello,

Thanks for your reply.
My problem is not completly resolved, it throw an error. I just try to explain exactly what I done. This is simple steps.

I just download jdk-7u2-windows-x64.exe to compile java class

I compile the Location.java to Location.class with

javac.exe path/to/Location.java

Works good.

I unjar sikuli-script.jar with winRAR
Just see it was possible here : http://siebelmantra.blogspot.com/2009/03/how-to-unjar-jar-file.html?showComment=1255521430693#c2260302387349205486

I overwrite the Location.class

I recreate the jar with:

jar.exe cfv sikuli-script.jar path/to/sikuli-script .

Works good

I overwrite the Sikuli X/sikuli-script.jar file

Launch my command

Sikuli-IDE.bat -s -r path/to/myproject.sikuli

And it throw an error in the terminal

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\__init__.py
", line 3, in <module>
  File "C:\Program Files (x86)\Sikuli X\sikuli-script.jar\Lib\sikuli\Sikuli.py",
 line 11, in <module>
java.lang.UnsupportedClassVersionError: org/sikuli/script/Location : Unsupported
 major.minor version 51.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClassCond(Unknown Source)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.privateGetPublicMethods(Unknown Source)

I need to compile the Location.java in a different way to works with Sikuli/JPython ?
What's wrong ?

Thanks again for your help

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