← Back to team overview

sikuli-driver team mailing list archive

[Question #287256]: importing self-built java package into a .sikuli project

 

New question #287256 on Sikuli:
https://answers.launchpad.net/sikuli/+question/287256



I have downloaded source code, and compiled a java class via javac. it's a chatbot with GUI, and it has swing imports etc. The code now has a java file and a class file.

import sys
import os.path

sys.path.append("C:\Documents and Settings\user")
sys.path.append("C:\Program Files\Java\jdk1.7.0_79\src")  
sys.path.append("C:\Python27\Lib\site-packages")
sys.path.append("C:\Documents and Settings\user.USER-C337190001   \nltk_data")

from javax.swing import JFrame, JButton, JTextField, JLabel, JTextArea,  JPanel, JScrollPane
from javax.swing import ChatBot

import nltk

from nltk.corpus import state_union
from nltk.tokenize import PunktSentenceTokenizer
from nltk.tokenize import sent_tokenize, word_tokenize

#bot implementation attempt

p = ChatBot()
Above is my .Sikuli file. As you can see, I have tampered with a bunch of sys.path lines of code to no avail.

As my last resort, I have tried to add my ChatBot.java file and ChatBot.class to the swing library. The path to the swing files is "C:\Program Files\Java\jdk1.7.0_79\src\javax\swing"

I tried to import the class this way to avoid scoping issues, seeing as though I could import things like JFrame just fine from swing. However, I am still getting--- "Cannot import name ChatBot

java swing import jython sikuli


-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.