How can I link .jar-Archivs to a class.

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

How can I link .jar-Archivs to a class.

Postby janvp » Wed Aug 08, 2012 8:04 pm

Hello,
I've got some classes and Packages in a .jar-file. Now I want to use this with the import funktion but on the NXT I get Error 16.
For Example:
The .jar-file contains the folder com.mysite.test. The test-folder contains the class testit.class.
My Programm has the following code:
Code: Select all
import com.mysite.test.*;
class tester{
public static void main(String[] args){
testit test = new testit();
}}

When I import the package with eclipse, I can run the Programm on the NXT, but I get the Error 16.
When I use nxjlink -cp "path to pack", I get a Package not found Error.(nxjc works)
When I add the folder of the package to the classes.jar, I can use nxjlink, but I get Error 16.

Thanks, Jan
Sorry for my English, but I try to improve it :)
janvp
New User
 
Posts: 4
Joined: Wed Aug 08, 2012 7:40 pm

Re: How can I link .jar-Archivs to a class.

Postby skoehler » Wed Aug 08, 2012 8:43 pm

janvp wrote:When I import the package with eclipse, I can run the Programm on the NXT, but I get the Error 16.


16 means, that you're getting a NullPointerException. Please follow the leJOS tutorial on how to find out where exactly the error happened.

janvp wrote:When I use nxjlink -cp "path to pack", I get a Package not found Error.(nxjc works)


Which package? your own? Or the one in the JAR file? Try -cp "/path/to/file.jar:/path/to/classfiles/generated/by/nxjc"

janvp wrote:When I add the folder of the package to the classes.jar, I can use nxjlink, but I get Error 16.


NullPointerException. It indicates a programming error.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm

Re: How can I link .jar-Archivs to a class.

Postby janvp » Fri Aug 10, 2012 11:46 am

I got a simple test to work :) . Now I must just find my programming mistake.
ArduinoLib - I'm comming :D
Thanks for your help!
Sorry for my English, but I try to improve it :)
janvp
New User
 
Posts: 4
Joined: Wed Aug 08, 2012 7:40 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff