library lejos.pc.com

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

Moderators: 99jonathan, roger, imaqine

library lejos.pc.com

Postby nikita190 » Fri Mar 30, 2012 10:12 pm

Hello, I'm working on a project with lego, and I have to get the robots to communicate with the PC, but it throws error, tells me that the library is not lejos.pc.comm ... and wanted to know if any of you know how to repair this error.

I'm using:
    - Jdk-6u25-windows-i586
    - Lejos_nxj_0.8.5 (I've also tried 0.9.0)
    - Netbeans 7.1
    - Win 7--64

Code: Select all
import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.remote.NXTCommand;
import lejos.pc.comm.*;
public class BlueTest {

public static void main(String[] args) throws Exception {
String nombre = "NXTTorna";
LCD.drawString("Conectando...", 2, 1);
LCD.refresh();

NXTConnector conn = new NXTConnector();

if (!conn.connectTo("NIKITA", NXTComm.LCP)) {
System.err.println("Conexión Fallida");
System.exit(1);
}

NXTCommand.getSingleton().setNXTComm(conn.getNXTComm());

LCD.drawString("Pulsa un boton", 2, 1);
while(!Button.ESCAPE.isPressed()){

}

LCD.clear();
LCD.drawString("Cerrando conexion", 0, 1);

LCD.clear();
LCD.drawString("Finalizado", 0, 1);
Thread.sleep(2000);
}
}



El error...
Code: Select all
reated dir: E:\Documents and Settings\db2admin\Escritorio\EjemploNXJ\build
Compiling 3 source files to E:\Documents and Settings\db2admin\Escritorio\EjemploNXJ\build
E:\Documents and Settings\db2admin\Escritorio\EjemploNXJ\src\BlueTest.java:4: package lejos.pc.comm does not exist
import lejos.pc.comm.*;
E:\Documents and Settings\db2admin\Escritorio\EjemploNXJ\src\BlueTest.java:40: cannot find symbol
symbol : class NXTConnector
location: class BlueTest
NXTConnector conn = new NXTConnector();
E:\Documents and Settings\db2admin\Escritorio\EjemploNXJ\src\BlueTest.java:40: cannot find symbol
symbol : class NXTConnector
location: class BlueTest
NXTConnector conn = new NXTConnector();
E:\Documents and Settings\db2admin\Escritorio\EjemploNXJ\src\BlueTest.java:42: cannot find symbol
symbol : variable NXTComm
location: class BlueTest
if (!conn.connectTo("NIKITA", NXTComm.LCP)) {
4 errors
E:\Documents and Settings\db2admin\Escritorio\EjemploNXJ\build.xml:24: Compile failed; see the compiler error output for details.
BUILD FAILED (total time: 0 seconds)




Please help, I've been trying day and I get nothing.
nikita190
New User
 
Posts: 18
Joined: Mon Mar 26, 2012 10:48 pm

Re: library lejos.pc.com

Postby skoehler » Fri Mar 30, 2012 11:20 pm

Use Eclipse, or use nxjpcc to compile your sources. Or add all jars in lib/pc to the classpath via the -classpath parameter of javac.
skoehler
leJOS Team Member
 
Posts: 1449
Joined: Thu Oct 30, 2008 4:54 pm

Re: library lejos.pc.com

Postby nikita190 » Sat Mar 31, 2012 1:37 am

Thanks for answering ..
I have added all the libraries to the CLASSPATH, and still does not work,
also tried the nxjpcc and strip me of the main class error :?
And I tried eclipse, but I also throw errors, so better follow working with netbeans.
nikita190
New User
 
Posts: 18
Joined: Mon Mar 26, 2012 10:48 pm

Re: library lejos.pc.com

Postby gloomyandy » Sat Mar 31, 2012 8:38 am

If you want to get help, you would be better off..
1. To use the most recent version of leJOS.
2. To use eclipse.
3. Take a step back from your own code and experiment with the sample code we supply, get that working first then create your own project but use the sample code as the project source (that way you can be sure you have working code to test your project setup). Finally replace the sample source with your own...
Yes I understand that you may prefer NetBeans and that you may need to update your code to the newer version, but pretty much all of the leJOS dev team now use eclipse and they will all be using the latest version, so you stand a much higher chance of getting help if you also use those tools. After all things are not working with what you have now...

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4180
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: library lejos.pc.com

Postby skoehler » Sat Mar 31, 2012 2:03 pm

nikita190 wrote:Thanks for answering ..
I have added all the libraries to the CLASSPATH, and still does not work,
also tried the nxjpcc and strip me of the main class error :?

I just realized that you're using ant. Please post your ant script and the output of a verbose ant run (ant -verbose)
Also make sure that the NXJ_HOME environment variable is set correctly or adjust the value of nxj.home in the build.properties file.

nikita190 wrote:And I tried eclipse, but I also throw errors, so better follow working with netbeans.

Use the IDE that is best supported by leJOS. And that is Eclipse, not Netbeans.
skoehler
leJOS Team Member
 
Posts: 1449
Joined: Thu Oct 30, 2008 4:54 pm

Re: library lejos.pc.com

Postby nikita190 » Sat Mar 31, 2012 8:05 pm

Install ecplise and did all the settings I found on: http://robobyte.blogspot.com/2010/02/co ... lipse.html
and elsewhere, but it throws an error:

Code: Select all
Exception in thread "main" java.lang.UnsatisfiedLinkError: lejos.nxt.LCD.getSystemFont()[B
   at lejos.nxt.LCD.getSystemFont(Native Method)
   at lejos.nxt.LCD.<clinit>(LCD.java:25)
   at BlueTest.main(BlueTest.java:11)


And for compile, says you have to create 3 files, which I believe and I throw tb problems.
    In compiling
    Code: Select all
     Location: C:\Program Files (x86)\leJOS NXJ\bin\nxjc.bat

    Error
    Code: Select all
     javac: no source files
    Usage: javac <options> <source files>
    use -help for a list of possible options


    In the link
    Code: Select all
    Location: C:\Program Files (x86)\leJOS NXJ\bin\nxj.bat

    Code: Select all
    No classes specified

    usage: nxj [options] class1 [class2 ...]
    options:
    -a,--all                         do not filter classes
    -b,--bluetooth                   use bluetooth
    -bp,--bootclasspath <classpath>  where to find leJOS classes
    -cp,--classpath <classpath>      where to find user's classes
    -d,--address <address>           look for NXT with given address
    -ea,--enableassert               enable assertions
    -ec,--enablechecks               enable run time checks
    -g,--debug                       include debug monitor
    -h,--help                        show this help
    -n,--name <name>                 look for named NXT
    -o,--output <path to file>       dump binary to file
    -r,--run                         run program
    -u,--usb                         use usb
    -v,--verbose                     print class and signature information
    -wo,--writeorder <write order>   endianness (BE or LE)


    and if you specified some action
    Code: Select all
    Location: C:\Program Files (x86)\leJOS NXJ\bin\nxj.bat
    Argument: nxj -r

    Code: Select all
    leJOS NXJ> Linking...
    an error occurred: Class nxj (file nxj.class) not found in CLASSPATH C:\Program Files (x86)\leJOS NXJ\lib\classes.jar;.

    I have all the ".Jar" of LeJOS in the -CLASSPATH


    In Upload
    Code: Select all
    Location: C:\Program Files (x86)\leJOS NXJ\bin\nxj.bat

    Throw the same mistakes that link


skoehler wrote:
I just realized that you're using ant. Please post your ant script and the output of a verbose ant run (ant -verbose)
Also make sure that the NXJ_HOME environment variable is set correctly or adjust the value of nxj.home in the build.properties file.


In netbeans to create LeJOS projects, type is used "FreeForm" and they use ant
nikita190
New User
 
Posts: 18
Joined: Mon Mar 26, 2012 10:48 pm

Re: library lejos.pc.com

Postby skoehler » Sat Mar 31, 2012 8:11 pm

nikita190 wrote:Install ecplise and did all the settings I found on: http://robobyte.blogspot.com/2010/02/co ... lipse.html


Please stop using tutorials found on the net. They won't work with current versions of leJOS and the authors usually don't care to update them. The author doesn't even mention for which version of leJOS that tutorial is (or at least I cannot find that). The tutorial is more than 2 years old. We have been very busy in the mean time! Download leJOS 0.9.1 and follow the official tutorial: http://lejos.sourceforge.net/nxt/nxj/tu ... clipse.htm

The new plug-in has several enhancements, which make life MUCH easier.
You'll need Eclipse 32Bit, at least 3.6.x
skoehler
leJOS Team Member
 
Posts: 1449
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 4 guests

cron
more stuff