[1.0.1] Importing java only includes __name__ and io

Asked by Techno.Scavenger

In Sikuli 1.0.0, importing java shows the following:

>>> import java
>>> dir(java)
['__name__', 'awt', 'io', 'lang']

In Sikuli 1.0.1, it shows:

>>> import java
>>> dir(java)
['__name__', 'io']

Is this a bug?

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

I do not know ;-)

But why is this of relevance?

All Java imports work as expected

from java.lang import System as JSys
print JSys.getProperty("user.home")

Revision history for this message
Techno.Scavenger (techno-scavenger) said :
#2

Maybe just for convenience? :) Stand-alone jython works that way. Sikuli 1.0.0 also works the same way.

Also, I was trying to use zxJDBC and tried to follow what was discussed in https://answers.launchpad.net/sikuli/+question/135452.

Like to verify if the classpath is correct, do:

import java
java.lang.System.getProperty('java.class.path')

Revision history for this message
RaiMan (raimund-hocke) said :
#3

The usage of Sikuli with Jython standalone is easier now with sikuli-java.jar (setup option 4) from version 1.0.1.

This needs only to be on class path and does not contain the Jython interpreter (like sikuli-script.jar).

when you say in your main script:
import org.sikuli.basics.SikuliXforJython
from sikuli import *

it even sets the sys.path correctly on the fly at runtime.

Can you help with this problem?

Provide an answer of your own, or ask Techno.Scavenger for more information if necessary.

To post a message you must log in.