Arduino on Linux

hi i was following the installation instruction on the post above without any trouble but as soon as i do ./run.sh i get this error:
olsen@ll-928:~/lab/arduino/trunk/build/linux$ ./run.sh
Exception in thread “main” java.lang.NoClassDefFoundError: processing.app.Base
at gnu.java.lang.MainThread.run(libgcj.so.7)
Caused by: java.lang.ClassNotFoundException: processing.app.Base not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:lib/,file:lib/build/,file:lib/pde.jar,file:lib/antlr.jar,file:lib/oro.jar,file:lib/registry.jar,file:lib/mrj.jar,file:lib/RXTXcomm.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=, parent=null}}
at java.net.URLClassLoader.findClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.ClassLoader.loadClass(libgcj.so.7)
at java.lang.Class.forName(libgcj.so.7)
at gnu.java.lang.MainThread.run(libgcj.so.7)

any clue around?
thanks&greets
olsen

I'm having trouble installing Arduino, because of the lack of Java in Ubuntu... I'm really not an expert with Linux, but would it be possible to have Arduino be stand-alone in the same way that Processing is?

Hey all,

I hope people are still watching this thread.

1. I'm trying to get arduino working on debian/etch using only packages available from repos (java from blackdown, as well as rxtx) I had package issues with 1.4 so I'm using 1.3 right now. I'm currently getting stuck with Jikes could not find package "java.lang" in it is not provided by any of the java packges I see.

2. Due to the "fun" of java I would greatly perfer a non java dependant version of arduino for linux. probably just a few scripts would do it, "arduino_upload" "arduino_download" "arduino_compile" and I guess a serial debugger... I've gone somewhere on this but even things like uuisp are not working quite so well:

uisp -dserial=/dev/ttyUSB0 -dspeed=9600 --download of=~/Projects/Arduino/test.pde -dprog=stk500 -dpart=ATmega8 -v=3

Programmer is not responding.

I saw somewhere on the playground that arduino uses the stk500. I was able to get a little more luck (downloading what I think is the firmware) using:

uisp -dserial=/dev/ttyUSB0 --download of=~/Projects/Arduino/test.pde -dprog=dasa -dpart=ATmega8 -v=3

Reset inactive time (t_reset) 1000 us AVR Direct Parallel Access failed after 32 retries. Override signature bytes, device ATmega8 assumed. Vendor Code: 0x1e Part Family: 0x93 Part Number: 0x07 Atmel AVR ATmega8 is found. Downloading: flash

Is there a more simple guide than http://www.arduino.cc/playground/Learning/BuildProcess on what the arduino IDE actually does?

Thanks.

I was able to fix the "java.lang" problem by editing the CLASSPATH to find rt.jar

So thats all I can do since the output is meaningless to me. Looks like I can't attach it to this post: http://b.goto10.org/misc/arduino_make.sh_output.txt

./run.sh gives me:

Exception in thread "main" java.lang.NoClassDefFoundError: processing/app/Base

Ok, looks like for some reason the make.sh script creates the work directory is such a way that it is not writible by the regular user?? so I did this:

sudo chown -R bbogart trunk/ sudo chgrp -R bbogart trunk/

looks like the svn make.sh script refers to something not in svn:

Extracting examples... unzip: cannot find or open ../shared/dist/examples.zip, ../shared/dist/examples.zip.zip or ../shared/dist/examples.zip.ZIP.

I'm guessing these java erros are due to my old 1.3 version, off to try some different packages...

so I've switched to blackdown 1.4 and It seems to compile! It would be nice for the makefile to print out "success" or something when it works, since I did not realize it with all the errors.

I build with DIRAVR=/usr so that the build could find the avr compiler. Now when I run the environment ./run.sh it says it can't find the compiler but it is in my path:

which avr-g++ /usr/bin/avr-g++

I'll post this and followup on the next steps.

Looks like the processing .class files have hard references to the compiler tools.

On linux it should just run avr-g++ which will be in the PATH when installed from a package.

I don't see how to edit the source to point to my own avr tools... since its encased in a binary .class file and the SVN trunk seems to contain no files used to generate that .class file.. ?

Maybe adding a setting in the "Perferences" for the Avr tool path would be best..?

.b.

I’ve tried using the script higher in this thread, and using the instructions from

http://www.arduino.cc/playground/Learning/Linux

but no matter what I do I can’t get arduino to find my avr-g++ binary (and I suppose neither the rest of the AVR toolkit)

ok, after searching it looks like these files refer to the tools/blah stuff:

Library.java, Compiler.java, Sizer.java, Uploader.java

Seems to me there should be a function that has the job of choosing where all the avr and uisp tools are.

Ok, HCS is making some changed to these files and I’ll post back here results.

anyone out there working on a debian package for arduino?

.b.

I just worked out a patch for the avr-gcc, etc. path issues with bbogart:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1156638816/0

Tested on Mac OS X and Linux.

I've documented the process of today at: http://www.arduino.cc/playground/Linux/Debian

Thanks much for your help with us. None of the core developers have regular access to a Linux box, so we rely on contributions to improve the process. If you have any other suggestions or fixes, please let me know. In particular, I'm curious about the need to chmod the Arduino files from svn. Who owned them when they were checked out? Did you check them out with a sudo?

I am trying to get the Arduino board installed on my Fedora Core 5 laptop: no luck yet. My problem appears to be with the Java GUI

I have followed the guid of an earlier post in this thread, taken form here: http://riereta.net/tiki/tiki-index.php?page=PdInstallationArduino

I was getting a strange error... check_group_uucp(): error testing lock file creation Error details: Permission deniedcheck_lock_status: No permission to create lock file. So I copied the proper rxtx version serial lib into the work directory ( cp /usr/java/jre1.5.0_07/lib/i386/librxtxSerial.so work/ ) Now I don't get that error.

When I run arduino: 1) I get the file selector dialog but no files are displayed. 2) When I enter a filename a directory within the work directory is created: for example if I try to open Pd_firmware.pde a directory is created work/NullPd_firmware.pde/

Is there a way to upload this firmware to the arduino from the command line?

Hi,

So I looked into it and this is the specific error:

Copying dist files... cp: cannot create regular file work/lib/.svn/empty-file': Permission denied cp: cannot create regular filework/lib/.svn/entries': Permission denied cp: cannot create regular file work/lib/.svn/format': Permission denied cp: cannot create regular filework/lib/.svn/README.txt': Permission denied

and this is beause the build/linux/dist/lib contains a few read-only files: -r--r--r-- 1 bbogart bbogart 0 2006-08-27 15:45 empty-file -r--r--r-- 1 bbogart bbogart 6192 2006-08-27 15:45 entries -r--r--r-- 1 bbogart bbogart 2 2006-08-27 15:45 format -r--r--r-- 1 bbogart bbogart 118 2006-08-27 15:45 README.txt

Which seems to be an .svn directory.. does svn creates this itself, or are they checked in? I tried running through again and the errors can be ignored (I did not realize that at the time.) if the compile fails and someone tries to recompile though then they need to override the readonly to delete the work/ directory.

probably best to have all files read-write for the current user.

Thanks for applying the patch to the svn! I'll update the howto accordingly.

How do I debug a java freeze???

Thanks much for your help with us. None of the core developers have regular access to a Linux box, so we rely on contributions to improve the process. If you have any other suggestions or fixes, please let me know. In particular, I'm curious about the need to chmod the Arduino files from svn. Who owned them when they were checked out? Did you check them out with a sudo?

yo on the second service i got the arduino compiled. with run.sh i get the file open dialog however steering f.e. to work/dist/examples/digital\ IO/ no files are displayed/can be chosen & selecting this (or others) directory it segfaults. what kind of file the selector is looking for to keep him goin?

Experimental: JNI_OnLoad called. Experimental: JNI_OnLoad called.

Stable Library

Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 Experimental: JNI_OnLoad called. ./arduino: line 51: 27916 Segmentation fault java processing.app.Base

I'm working on installing on Arch Linux, which has no avr packages Just wanted to say that I found this website http://www.nongnu.org/avr-libc/user-manual/install_tools.html it seems to have good instructions for compiling gcc binutils and libc for avr. I'm in the midst of it now, i'll post back if its successful

That works! I have the Arduino devel evironment running under Arch Linux If anybody needs help with that lemme know.

i'm trying to make arduino work from the command line on my fedora core 6 box. since there are no avr-gcc rpms available at the time of writing for fedora, i compiled them myself. using the instructions from here: http://www.arduino.cc/playground/Learning/CommandLine i'm trying to compile a simple example code, but i'm getting errors:

avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
        --change-section-lma .eeprom=0 -O ihex foo.elf foo.eep
avr-objcopy: there are no sections to be copied!
avr-objcopy: --change-section-lma .eeprom=0x00000000 never used
make: [foo.eep] Error 1 (ignored)

avr-objdump gives the following output:

$ avr-objdump -h foo.elf 
foo.elf:     file format elf32-avr
Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         00001050  00000000  00000000  00000094  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .data         00000096  00800060  00001050  000010e4  2**0
                  CONTENTS, ALLOC, LOAD, DATA
  2 .bss          0000009b  008000f6  008000f6  0000117a  2**0
                  ALLOC
  3 .stab         00002280  00000000  00000000  0000117c  2**2
                  CONTENTS, READONLY, DEBUGGING
  4 .stabstr      000016fd  00000000  00000000  000033fc  2**0
                  CONTENTS, READONLY, DEBUGGING

the versions of the software i'm using are the following: avr-binutils-2.17, avr-gcc-4.1.1, avr-gcc-g++-4.1.1, avr-libc-1.4.5.

$ avr-gcc -v
Using built-in specs.
Target: avr
Configured with: ./configure --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib --target=avr --disable-libssp --enable-languages=c,c++ --disable-libmudflap --disable-libiberty --disable-libstdc
Thread model: single
gcc version 4.1.1

any help would be appreciated.

i figured it can be a problem of avr-binutils, although the program can be uploaded regardless of the error.

objcopy.c should be patched at about line 1421:

    if (bfd_count_sections (obfd) == 0)
    {
      non_fatal (_("there are no sections to be copied!"));
      return FALSE;
    }

FALSE can be changed to TRUE to avoid the error.

reference: http://2313.avrfreaks.net/index.php?name=PNphpBB2&file=printview&t=39014&start=0&POSTNUKESID=9c998e6153cb4e6bba14ec5311d6cc05

gabor: the error seems to be appearing in a command to build a file you don't really need. You can modify the Makefile to not build it at all. Change line 127 from:

build: elf hex eep

to:

build: elf hex

And change line 136 from:

upload: $(TARGET).hex $(TARGET).eep

to:

upload: $(TARGET).hex

This will be fixed soon.

Hi, I just compiled everything needed to run arduino on Linux by myself and it works fine.

I just missed the hint to build an avr-g++ either - but that was a minor problem to be fixed easily.

Just follow blindly step by step the buildprocess of an avr-environment, install some JRE, jikes, RXTX, build the usb-serial kernel module, get the IDE via the subversion repository, set up pathes and environment variables and smile happily at your blue-ish IDE. :)

Now I have to wait for the actual board as I just placed my order two hours ago.

Just to report some success... (Slackware 11.0)

mellis, thanks for your help.

on the other hand, i'm planning to submit the avr rpms to fedora repositories. if they got excepted users will be able to install avr development tools easier in the future in fedora.

Hey All, I had a little trouble getting things to run on Ubuntu Edgy AMD64. I had to install the package "librxtx-java" first. Then I had to fix the CLASSPATH reference to the local copy of RXTXcomm.jar. It needs to point to "/usr/share/java/RXTXcomm.jar". Next I had to make two changes to the dist/arduino script. I had to again, swap the reference to the installed RXTXcomm.jar and then I had to change the LD_LIBRARY_PATH to point to /usr/lib instead of the {cwd}/lib so that it will find the correct .so files. I can supply patches if needed.