uirtj building and usage help please

Interested in integrating USB-UIRT support into an application? Look here!

Moderator: jrhees

uirtj building and usage help please

Postby edderd » Fri Oct 12, 2007 11:43 pm

I've been trying to make use of the uirtj java package but am fairly frustrated at this point. The readme.txt file doesn't help much except to make sure you have a compile and dllwrap and uuirtdrv.dll.

I'm running WinXP, cygwin gcc version gcc-3.4.4-3, java version 1.5.0_13
GNU dllwrap 2.17.50 20060817

I've tested the uuirtdrv.dll by running the (downloaded from sourceforge) executable jar file and receiving and transmitting IR using the USB-UIRT device.

My object is to be able to transmit IR only. No IR listening is necessary.

I've downloaded the uirtj-src.zip and uirtj-bin.jar file and am able to invoke the uirtj-bin.jar and run it successfully.

I've been able to compile the uirtj-src by running both and and make.bat if I comment out some code in USBUIRT.java.

Once I build everything, I'm unable to get a sanity check by running the uirtj-bin.jar file. I'm also not sure whether I've generated everything I need or how to proceed.


Here are the steps I've taken:

Both ant and make.bat compiles yield two compilation errors in USBUIRT.java which are easily worked around by commenting out the calls to listenerList.add, since I'm only interested in tranmitting IR.

public static void addReceiveListener(ActionListener listener){
// listenerList.add(ReceiveListener.class, listener);
}

public static void addLearnListener(ActionListener listener){
// listenerList.add(LearnListener.class, listener);
}

1. Build with ant and then make.bat:

ant
Buildfile: build.xml

clean:

init:
[mkdir] Created dir: C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake\bin
[mkdir] Created dir: C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake\dist

compile:
[javac] Compiling 5 source files to C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake\bin
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

dist-src:
[zip] Building zip: C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake\dist\uirtj-src.zip

dist-bin:
[jar] Building jar: C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake\dist\uirtj-bin.jar

all:

BUILD SUCCESSFUL
Total time: 3 seconds
C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake>make.bat
make.bat

C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake>javac -classpath ./bin -d bin src/util/*.java src/ui/*.java
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake>javah -classpath bin -jni -d lib util.USBUIRT

C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake>gcc -Ilib -I\jdk\include -I\jdk\include\win32 -Wall -c -o bin\util_USBUIRT.o src\util_USBUIRT.cpp

C:\development\installs\USBUIRT\Java\uirtj-src-10-12.firstAntThenMake>dllwrap -Isrc -I\jdk\include -I\jdk\include\win32 --def lib\util_USBUIRT.def -o util_USBUIRT.dll bin\util_USBUIRT.o

This Yields:
1. a util_usbUIRT.dll of size 20655

2. the header files in the lib directory are originally:
c:/development/installs/USBUIRT/Java/uirtj-src-10-12.antBuild/lib:
USBUIRT.properties
util_USBUIRT.def
util_USBUIRT.h
uuirtdrv.h

make generates this:
c:/development/installs/USBUIRT/Java/uirtj-src-10-12.make/lib:
USBUIRT.properties
util_USBUIRT.def
util_USBUIRT.h
util_USBUIRT_EventHandler.h
util_USBUIRT_Format.h
util_USBUIRT_LearnEvent.h
util_USBUIRT_LearnListener.h
util_USBUIRT_NoDLLException.h
util_USBUIRT_NoDeviceException.h
util_USBUIRT_NoResponseException.h
util_USBUIRT_NotInitializedException.h
util_USBUIRT_ReceiveEvent.h
util_USBUIRT_ReceiveListener.h
util_USBUIRT_UIRTConfig.h
util_USBUIRT_UIRTException.h
util_USBUIRT_UIRTInfo.h
util_USBUIRT_VersionException.h
uuirtdrv.h

3. all the class files appear to be built in the bin directory.
4. and the make output looks like this:

the ant build yeilds:

1. util_USBUIRT.dll of size 20655.
2. a dist directory containing uirtj-bin.jar and uirtj-src.zip
3. a bin directory containing all the compiled classfiles.

Then I tried:
The compiled uirtj-bin.jar file would not execute and returned
at util.JarLauncher.extractResource(Unknown Source)
at util.JarLauncher.main(Unknown Source)

(Please note the the one I downloaded from sourceforge ran fine.)

running usbuirt.bat hangs and had to be killed.

So, any help is appreciated.

Ed
Ed
edderd
 
Posts: 1
Joined: Fri Oct 12, 2007 10:22 pm
Location: Denver

Postby ebariaux » Sun Dec 02, 2007 3:53 pm

What are you trying to achieve?
I don't understand why you're trying to recompile UIRT-J?

I used it in a Java program but just adding uirtj-bin.jar to my classpath and using the provided java class.

Eric
ebariaux
 
Posts: 4
Joined: Sun Jan 04, 2004 8:21 am
Location: Belgium


Return to Developers

Who is online

Users browsing this forum: No registered users and 17 guests

cron