git master and alpha-0.4.0

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

Moderators: roger, gloomyandy, skoehler

git master and alpha-0.4.0

Postby Lunactic » Tue Oct 15, 2013 10:38 am

Hi Andy

I have a question regarding the 0.4.0-alpha.

I was able to create/boot and connect to the Wifi without any problems. And I can also run the HelloWorld application.

What I would like to do now is to create some own Applications.
What I've seen is that you changed quite a lot of package names and everything in the current 0.4.0-alpha version.

So now when for Example I try to run the EV3ColorTest with the following command: (after packing it into a *.jar file)
jrun -cp EV3ColorTest.jar EV3ColorTest

I get the following error
Exception in thread "main" java.lang.NoClassDefFoundError: lejos/hardware/sensor/EV3ColorSensor

So i checked the ev3classes.jar present on the brick and saw that on there, the classes are still in the old places.

Can I just create a new ev3classes.jar from the sources and copy it over the current one?

Cheers,
Lunactic
Lunactic
New User
 
Posts: 2
Joined: Tue Oct 15, 2013 10:28 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Tue Oct 15, 2013 1:44 pm

You have two choices. You can either checkout the release as it was for the 0.4.0-alpha release by specifying that as a tag when you pull from git, or you can build your own version of ev3classes.jar and specify that using the -cp argument to jrun. Do not replace the version of ev3classes.jar on the sdcard as this version is used by various programs that are used to boot and shutdown the EV3.

The safe option would be to use the tagged version of the source, as things are changing a lot on master and will change a lot more before we make the next release. However if you want to experience the cutting edge then feel free to grab master, but I would do so very soon as the entire sensor side of things is about to have big changes made to it.

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

Re: leJOS and Lego Mindstorms EV3

Postby dendrobates » Fri Oct 18, 2013 12:56 pm

Hi,
I have the same error. So I tried to get an older revision. When I right click on the folder ev3classes, I choose Replace With -> Commit. There I choose the revision from the September 22th. After redoing the jar file from my project, I still got the same error. What am I doing wrong? Thanks for your help.
Best regards
Beat
dendrobates
New User
 
Posts: 16
Joined: Tue Sep 10, 2013 7:08 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Fri Oct 18, 2013 2:35 pm

Are you sure that you have rebuilt the ev3classes.jar after you checked out the tag and that you are specifying this file using -cp when running your program using jrun? Also are you sure that you have rebuilt your test program using the updated ev3classes project? You will probably need changes to make it use the older location for the various classes.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4072
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS and Lego Mindstorms EV3

Postby dendrobates » Fri Oct 18, 2013 3:21 pm

Hi Andy
How do I specify the the new jar file by using -cp? I normally ran my program with the command jrun -cp XX.jar XX. Thanks for your super support.
Kind Regards
Beat
dendrobates
New User
 
Posts: 16
Joined: Tue Sep 10, 2013 7:08 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Fri Oct 18, 2013 4:18 pm

Just as with the standard java command line you specify the jars you want to use with colon separators so :
jrun -cp <path to new ev3classes.jar>:<your jar> XX
DO NOT replace the evclasses.jar on the Sd card with your newly built version. I assume you have built a new ev3class.jar file using export or whatever in eclipse?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4072
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS and Lego Mindstorms EV3

Postby jwebber23 » Sun Oct 20, 2013 8:56 am

Thanks again for all your help before getting my SD card up and running.

I have managed to get BumperCar running and am working my way through a book from the library, Maximum Lego NXT - Building Robots With Java Brains. With your new version of classes for the EV3 all the names have changed so with BumperCar and the example in the books I look through the EV3Class to find the new name of the class to get things working. Do you have a reference table to show the NXT name and the new EV3 name to aid me in using the NXT examples.

The example I had an issue with was finding pilot under navigation, I ended up using the legacy pilot...

Thanks again for all the great work you have done and all the help you provide all the beginners :D
jwebber23
New User
 
Posts: 8
Joined: Sat Oct 05, 2013 9:26 am

Re: leJOS and Lego Mindstorms EV3

Postby dendrobates » Mon Oct 21, 2013 8:29 am

Dear Andy.

I still got the same error. I did an export of the ev3classes and I exported the MC.jar. Then i ran the command "jrun -cp /home/ubuntu/git/ev3/ev3classes/ev3classes.jar:MC.jar MC" and I still got the same error:
classpath: /home/ubuntu/git/ev3/ev3classes/ev3classes.jar:MC.jar:/home/root/lejos/lib/ev3classes.jar:/home/root/lejos/libjna/usr/share/java/jna.jar:.
Exception in thread "main" java.lang.NoClassDefFoundError: lejos/hardware/motor/Motor
at MC.<clinit>(MC.java:15)
Caused by: java.lang.ClassNotFoundException: lejos.hardware.motor.Motor
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more
What am I still doing wrong? Thanks a lot for your help.
Kind regards
Beat
dendrobates
New User
 
Posts: 16
Joined: Tue Sep 10, 2013 7:08 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Mon Oct 21, 2013 11:37 am

The ev3classes.jar needs to be on your SD card or accessible from the EV3 (if you are using something like NFS) and the cp setting needs to be to that location, it looks like you are specifying a location on your ubuntu build system.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4072
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS and Lego Mindstorms EV3

Postby dendrobates » Mon Oct 21, 2013 3:12 pm

Dear Andy
I feel like a complete retard, but I don't get it to work. Now I exported the ev3class.jar into the root directory of my ev3. Then I ran the comand
jrun -cp /home/root/:MC.jar MC and still the same:
classpath: /home/root/:MC.jar:/home/root/lejos/lib/ev3classes.jar:/home/root/lejos/libjna/usr/share/java/jna.jar:.
Exception in thread "main" java.lang.NoClassDefFoundError: lejos/hardware/motor/Motor
at MC.<clinit>(MC.java:15)
Caused by: java.lang.ClassNotFoundException: lejos.hardware.motor.Motor
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 1 more

So I tried: jrun -cp /home/root/ev3classes.jar:MC.jar MC and got this error
classpath: /home/root/ev3classes.jar:MC.jar:/home/root/lejos/lib/ev3classes.jar:/home/root/lejos/libjna/usr/share/java/jna.jar:.
Exception in thread "main" java.lang.ExceptionInInitializerError
at MC.<clinit>(MC.java:15)
Caused by: java.lang.NullPointerException
at lejos.hardware.motor.Motor.<clinit>(Motor.java:30)
... 1 more
It looks like when I point to the folder it still takes the "home/root/lejos/lib/ev3classes.jar". On the other hand when I specify the path and the ev3classes jar it still has problems with the motor class. Thanks for your help.
dendrobates
New User
 
Posts: 16
Joined: Tue Sep 10, 2013 7:08 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Mon Oct 21, 2013 4:03 pm

You have to specify the actual jar file not a path to a folder, so the second case is correct. No idea why you are getting the Null pointer error. How did you build your ev3classes.jar file? Did you ensure that you unchecked all of the options to include the classpath and the various files? How up to date are your files from git? These files are changing on an hourly basis at the moment.

Remember some time ago how I said that things are unstable and that the best option would be to use the tagged files. Well this is why I said that. I will try a test program that uses the motors with the latest git state if I get chance, but git master is very unstable at the moment.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4072
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS and Lego Mindstorms EV3

Postby dendrobates » Tue Oct 22, 2013 12:43 pm

Dear Andy

I still have some errors but different ones then yesterday. How do I check out tagged files. I always did my checkout by rightclick on the ev3classes->replace with ->commit. And there I can check out the different versiones. But I don't find a field named tag. Thanks for your help.

Kind regards
Beat
dendrobates
New User
 
Posts: 16
Joined: Tue Sep 10, 2013 7:08 am

Re: leJOS and Lego Mindstorms EV3

Postby gloomyandy » Tue Oct 22, 2013 1:37 pm

You might want to read the egit documentation. That has details of all of this stuff. Anyway try team->switch to->other and in the branch dialog you should see tags the 0.4.0 tag is in there and you should be able to check it out.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4072
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: leJOS and Lego Mindstorms EV3

Postby dendrobates » Fri Nov 01, 2013 8:49 am

Dear Andy
I just wanted to thank you for your great support. The robot is running again and I can proceed with my thesis. I'm very glad that I have such good help in this forum. Thanks for that.
Kind regards
Beat
dendrobates
New User
 
Posts: 16
Joined: Tue Sep 10, 2013 7:08 am

Re: leJOS and Lego Mindstorms EV3

Postby EowynCarter » Sat Nov 02, 2013 10:39 am

Hi there.

Being Linux user and java developer for a living, i'm interested in running LejOS on my EV3.

A few question.
After creating the SD card, ev3 will detect it, and boot LejOS ? Removing the SD will go back to lego firmware ?
Is wi-fi still needed ? What about Bluetooth ? I don't own a wi-fi dongle, and it takes space. And sometimes access to usb port is blocked.

If i understand it right, EV3 sensors works, NXT and hi-technic sensor are no dice yet ?
EowynCarter
New User
 
Posts: 8
Joined: Sat Nov 02, 2013 10:27 am

Next

Return to EV3 Software

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

more stuff