Compiling Lejos PC API

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

Moderators: 99jonathan, roger, imaqine

Compiling Lejos PC API

Postby oceank2 » Mon Jun 11, 2012 4:31 pm

I want to make a Lejos activity with a tool named "javascool".
So i have to compile this lejos activity with javascool.
But I don't understand what you say about the file classes.jar :
"For compiling and running leJOS PC API programs you need pccomm.jar and bluecove.jar (Linux users also need bluecove-gpl) in your CLASSPATH and classes.jar must be removed. Also, the java library path needs to be set."

What is this file ? Where is it ?

Why do i have to remove it from compilation. Javascool program need it !
Can anyone explain me about that ?

Thanks in advance.
oceank2
New User
 
Posts: 7
Joined: Mon Jun 11, 2012 4:14 pm

Re: Compiling Lejos PC API

Postby skoehler » Mon Jun 11, 2012 4:40 pm

oceank2 wrote:I want to make a Lejos activity with a tool named "javascool".
So i have to compile this lejos activity with javascool.
But I don't understand what you say about the file classes.jar :
"For compiling and running leJOS PC API programs you need pccomm.jar and bluecove.jar (Linux users also need bluecove-gpl) in your CLASSPATH and classes.jar must be removed. Also, the java library path needs to be set."


From which page is this quote? It's a case of poor choice of words (I think I even wrote it). All it tries to tell you is, that classes.jar MUST NOT be part of the classpath.
The file itself (which comes with leJOS and resides in lib/nxt) must not be deleted or moves.

oceank2 wrote:Why do i have to remove it from compilation. Javascool program need it !
Can anyone explain me about that ?


Javascool needs it? I have no clue about Javascool and I have to assume that you know what you are doing if you want to use javascool for a leJOS PC project (which is for Java programs running on the PC, remotecontrolling the NXT) and not a leJOS NXT project (which is for projects running on the NXT brick itself). If javascool is for programs that run on the PC, then javascool does not need classes.jar. In case of a leJOS PC project, classes like java.lang.Integer is provided by the JDK (like the ones from Oracle) and not by the classes.jar.

Update: Google can't tell me what "Javascool" is. Please elaborate.
skoehler
leJOS Team Member
 
Posts: 1421
Joined: Thu Oct 30, 2008 4:54 pm

Re: Compiling Lejos PC API

Postby oceank2 » Mon Jun 11, 2012 5:33 pm

"For compiling and running leJOS PC API programs you need pccomm.jar and bluecove.jar (Linux users also need bluecove-gpl) in your CLASSPATH and classes.jar must be removed. Also, the java library path needs to be set."
You can find this assertion at the link below [Using PC API command line tools PART] :
http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/CompileAndRun.htm

When you say "classes.jar MUST NOT be part of the classpath." what do you mean exactly ? I am not a java expert so I need some help in order to undestand what you mean about it !

So I think that if I add the jar : pccomm.jar and bluecove.jar it may works fine !
I am going to try this as soon as possible.

Javascool is a very very simple IDE for educationnal purpose wich i plan to use with my student next september. It offers the student (college : 17/18 years old) the ability to do activities in Java. In the same environment, they have the description of the activity and a work space where they can write their own simple java programs, compile it and run it.
For instance, one of the activity i plan to propose my students is an activity with a control panel of the NXT. In this panel there will be 6 buttons. One to start the NXT, One to stop it, 4 arrows buttons for direction (left, right, forward, backward)...
The aim of this project is for the student to use the Lejos PC API to program button actions. For this they have to use communication function over Lejos/Bluetooth. They also have to do the program to upload on the NXT (.nxj).

Here a link about Javascool (At the momment it is a beta project - it is a french project fron Sophia Antipolis universty in south France):

http://javascool.gforge.inria.fr/
http://javascool.gforge.inria.fr/index.php?page=proglets

Best regard

Christophe Béasse
oceank2
New User
 
Posts: 7
Joined: Mon Jun 11, 2012 4:14 pm

Re: Compiling Lejos PC API

Postby skoehler » Mon Jun 11, 2012 5:49 pm

oceank2 wrote:"For compiling and running leJOS PC API programs you need pccomm.jar and bluecove.jar (Linux users also need bluecove-gpl) in your CLASSPATH and classes.jar must be removed. Also, the java library path needs to be set."
You can find this assertion at the link below [Using PC API command line tools PART] :
http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/CompileAndRun.htm

When you say "classes.jar MUST NOT be part of the classpath." what do you mean exactly ? I am not a java expert so I need some help in order to undestand what you mean about it !

So I think that if I add the jar : pccomm.jar and bluecove.jar it may works fine !
I am going to try this as soon as possible.

Since Javascool is an IDE, there will be some way to configure the classpath (which contains all the dependencies of your program).
It sounds, like you have found that already, but nobody told you that this list of JAR files is usually called classpath.
Your plan sounds correct. Simply add pccomm.jar and bluecove.jar. The text you quoted simply says, that you should not add classes.jar.
skoehler
leJOS Team Member
 
Posts: 1421
Joined: Thu Oct 30, 2008 4:54 pm

Re: Compiling Lejos PC API

Postby oceank2 » Mon Jun 11, 2012 5:57 pm

Good, thaks for your reply
I'll test it as soon as possible
oceank2
New User
 
Posts: 7
Joined: Mon Jun 11, 2012 4:14 pm

Re: Compiling Lejos PC API

Postby oceank2 » Thu Jun 14, 2012 12:35 pm

Hi,

I succeeded with the integration of lejos PC API in javascool :) . But in order for the program to run I need to add the directory native/windows/x86/jfantom.dll in the directory where my java application is (javascool.jar).
Can I specified the location of this jfantom.dll file calling a lejos function [for instance setJfantomPath(String path)] before using USB or Bluethooth functions. Well I want to launch my application (javascool.jar) just by clicking on it with the mouse. So I will prefer not to launch it via a javascool.bat file with java.exe parameter specifying the location of the jfantom.dll.
I don't know if I am clear ! of what i would like to do.

Thanks for your help

Christophe Béasse
oceank2
New User
 
Posts: 7
Joined: Mon Jun 11, 2012 4:14 pm

Re: Compiling Lejos PC API

Postby skoehler » Thu Jun 14, 2012 12:41 pm

The native folder has to reside inside the same folder as pccomm.jar. I think, that you created a copy of pccomm.jar, right? Instead of copying it, I would have recommended that you leave pccomm.jar where it is now (c:\program files\leJOS NXJ\lib) and simply configure javascool to use pccomm.jar in c:\program files\leJOS NXJ\lib. I do assume that javascool lets you add external JAR files to your project configuration - in other words: I assume that javascool doesn't force you to create a copy of the JAR file, or does it?

BTW: another good Java IDE for which a leJOS plugin exists is Eclipse.
skoehler
leJOS Team Member
 
Posts: 1421
Joined: Thu Oct 30, 2008 4:54 pm

Re: Compiling Lejos PC API

Postby oceank2 » Thu Jun 14, 2012 3:19 pm

Yes, I copy pccomm.jar in the directory of my java application, because javascool has to generate a jar file with all the ressources needed for my application. I ask to javascool developer I think I can do what you sau with the next version of javascool.
Best regards

Christophe
oceank2
New User
 
Posts: 7
Joined: Mon Jun 11, 2012 4:14 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 4 guests

more stuff