Arduino on Ubuntu Edgy - troubles with jikes

Hi everyone,

I’m trying to set up my Arduino on Ubuntu Edgy, by following this howto:
http://www.arduino.cc/playground/Linux/Debian

[I don’t change my repositories, though, since I get to install all the packages (gcc-avr avr-libc uisp jikes j2re1.4 j2sdk1.4) with the multiverse and universe repositories in Edgy]

Compiling goes ok, but when I execute run.sh I get:

x$ ./run.sh 
[: 51: ==: unexpected operator

It appears that the version of Jikes distributed with Processing
cannot properly run on this system.

Possible solutions:

+ If you already have Jikes installed on your system, you may
just need to remove the version that is included with Processing.

+ You probably just need to track down a version of Jikes that will
work with your distribution.

+ You may need to install the rpm/package for compat-libstdc++
This is what it takes to get things running on most versions
of RedHat Linux or Fedora Core.

+ If all else fails, or if you just like building stuff yourself,
you can download the source for Jikes from SourceForge:
http://sourceforge.net/project/showfiles.php?group_id=128803
And it just takes a simple ./configure and make, followed by
copying src/jikes to the processing-XXXX folder and you should
be all set.

If you get stuck, ask questions online from the helpful folks via
the Processing discussion board: http://processing.org/discourse/

Good luck!

Here is the versions of java and jikes:

$ java -version
java version "1.4.2-02"
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-02)
Java HotSpot(TM) Client VM (build Blackdown-1.4.2-02, mixed mode)
$ jikes -version
Jikes Compiler - Version 1.22 - 3 October 2004
Copyright (C) IBM Corporation 1997-2003, 2004.
- Licensed Materials - Program Property of IBM - All Rights Reserved.
Originally written by Philippe Charles and David Shields of IBM Research,
Jikes is now maintained and refined by the Jikes Project at:
<http://ibm.com/developerworks/opensource/jikes>
Please consult this URL for more information and for reporting problems.

I use this java:

$ sudo update-alternatives --config java
Password:

There are 5 alternatives which provide `java'.

  Selection    Alternative
-----------------------------------------------
          1    /usr/bin/gij-wrapper-4.1
          2    /usr/lib/jvm/java-gcj/jre/bin/java
          3    /usr/lib/j2re1.5-sun/bin/java
          4    /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
*+        5    /usr/lib/j2se/1.4/bin/java

Press enter to keep the default[*], or type selection number:

Does someone know how to solve this?

:slight_smile:

Hmm... not sure you even need the jikes test at all. Trying editing work/arduino and removing the line containing jikes and everything following it, except for the java processing.app.Base line. Then try run.sh again.

Thanks! It now works! I tried just running the command "java processing.app.Base " yesterday, but uncommenting all other lines in work/arduino did the trick!

:-)

I was having the exact same problem...I'll have to try this fix ASAP. Thanks in advance!

Works like a charm!

Hmmm...works for me, too. but I get an error when the ide starts: "Could not find compiler. arv-g++ is missing from your PATH."

avr-gcc is the newest version. Must be a simple fix, but I'm not an expert at linux, by any means.

You need avr-g++ (the C++ compiler) as well as avr-gcc (the C compiler). Perhaps it's a separate package? Or if you did install avr-g++, is it in your path?

locate avr-g++ /usr/bin/avr-g++

export shows my path is: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games"

So It looks like it's there, and the directory is in the path. If it's a seperate package, I don't know what the package name is.

Sorry for hijacking this thread!

Huh. Are you launching the IDE from a terminal/shell (i.e. wherever you got export to dump your path)? Maybe if you launch from a GUI, you get a different path?

Well, I'm launching from a terminal in linux -- ./run.sh

Actually, I found a whole thread about this. I guess it's a bug. There's a patch:

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

But I don't know how to use it.

That patch has been incorporated into the Arduino source, so you shouldn't need to apply it yourself.

Does the error message really say "arv-g++" (instead of "avr-g++")? Because that would be a problem.

You might try commenting out these two lines in build/linux/work/arduino:

PATH=`pwd`/`dirname $0`:`pwd`/java/bin:${PATH}
export PATH

I’m using Kubuntu Edgy 6.10, and in my case I get error message like this, when I run ./run.sh

Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.

I think I set my CLASSPATH to the right place, but do I have to set my PATH to this directory as well ?

This is what I have set right now :

ubuntu@ubuntu:~/arduino-0006/build/linux$ echo $CLASSPATH
/usr/lib/j2se/1.4/jre/lib/i386:/usr/lib/j2se/1.4/bin:/usr/lib/j2se/1.4/jre/lib/rt.jar

ubuntu@ubuntu:~/arduino-0006/build/linux$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games

I’m still a newbie, but how do I tell java to look libjava.so in the rigt place ?

Isao

isachan: it's probably controlled by the LD_LIBRARY_PATH variable. Do you have libjava.so on your machine?

I believe I do.

it's in : /usr/lib/j2se/1.4/jre/lib/i386/

So, how do I set this path to LD_LIBRARY_PATH ?

Like this ? set LD_LIBRARY_PATH=/usr/lib/j2se/1.4/jre/lib/i386/

Isao

You can edit the script in ARDUINO/build/linux/work/arduino (which gets copied from build/linuxdist/arduino when you run make.sh) and add the directory to the LD_LIBRARY_PATH there.

Arrgh. I edited the arduino script like you've told me as below :

put the directory with the native RXTX libs in the library path

LD_LIBRARY_PATH=pwd/lib:${LD_LIBRARY_PATH}

LD_LIBRARY_PATH=/usr/lib/j2se/1.4/jre/lib/i386:pwd/lib:${LD_LIBRARY_PATH} export LD_LIBRARY_PATH

And still it can't find the libjava.so

I get the same error message when I type just 'java'.

I don't know what else I can do to solve this problem.

Isao

I'm a bit baffled and don't know much about Ubuntu. I've tried Googling for the problem, but didn't find anything useful. Which version of Java are you running? How did you install it? You might try installing Java from Sun.

I installed java with very common way in Ubuntu (Debian) world, like this :

sudo apt-get install j2re1.4 j2sdk1.4

Just like the tutorial says here : http://www.arduino.cc/playground/Linux/Debian

I'll try again much later with Knoppix 5.01. It's more stable than 6.10 Edgey

Isao

You might also try an Ubuntu forum, especially if java doesn't run at all.