Arduino Forum

Using Arduino => Installation & Troubleshooting => Topic started by: SurferTim on Apr 25, 2015, 08:40 pm

Title: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on Apr 25, 2015, 08:40 pm
I just upgraded to Ubuntu v15.04 64 bit and am having problems saving sketches. When I load a sketch, all is ok until I want to save it. When I select "File - Save As", the IDE crashes and aborts. In some tries, it locks up with a blank "Save As" window.

I tried with IDE v1.0.5 and v1.6.3 with the same results. It worked fine with Ubuntu v14.10 64 bit.

I am starting to regret upgrading the Ubuntu OS. Anyone else experiencing this?

edit: It does OK if I run as root. The IDE menu bar changes also when run as root.

It generates an error log. I attached a txt version of the last log it generated.

When run as user, it displays this message.
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
When run as root, it doesn't.
Title: Re: Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on Apr 25, 2015, 10:32 pm
I found a solution by editing the arduino shell script. Look below to see where to insert the "export JAVA_TOOL_OPTIONS" environment variable.
Code: [Select]
#!/bin/bash

CURDIR=`pwd`
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"

cd "$APPDIR"

for LIB in \
    java/lib/rt.jar \
    java/lib/tools.jar \
    lib/*.jar \
    ;
do
    CLASSPATH="${CLASSPATH}:${LIB}"
done
export CLASSPATH

export JAVA_TOOL_OPTIONS=""


LD_LIBRARY_PATH=`pwd`/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

export PATH="${APPDIR}/java/bin:${PATH}"

if [[ "$@" == *"--upload"* || "$@" == *"--verify"* || "$@" == *"--get-pref"* ]] ; then
SPLASH=""
else
SPLASH="-splash:./lib/splash.png"
fi

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $SPLASH processing.app.Base --curdir $CURDIR "$@"
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 05, 2015, 09:05 pm
Hi, could you please tell me which file I have to edit and where it is located? I cannot find it. thx
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 05, 2015, 09:44 pm
It is the shell script you run to start the IDE. It is 'arduino' in the arduino-1.6.3 directory.

edit: I tried to attach my modified script, but the forum software won't allow it. :(

You can test this without editing the shell script. Open a command terminal, navigate to the arduino directory where the arduino shell script is located (like /arduino-1.6.3), then type these lines:
Code: [Select]
export JAVA_TOOL_OPTIONS=""
./arduino

This only works until you close the terminal, then the environment variable returns to its default setting. Editing the arduino file is the most efficient way to do it.



Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: siriusjbw on May 06, 2015, 12:38 am
I was having the same problem, and I can't find the directory with the shell script.
Where is this directory?
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 06, 2015, 12:45 am
I did not download the IDE from the Ubuntu repository. I download my IDEs from the Arduino website.

The arduino script file is in the directory that was unpacked from the downloaded package. I unpack mine in Downloads. So for IDE version 1.6.3, the directory where my arduino file is located is /Downloads/arduino-1.6.3/

Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 06, 2015, 02:23 pm
Ok, thats the reason why I could not find it. I installed it from the ubuntu app center. Meanwhile I installed it via apt command in the terminal. That is the suggested installation method on the arduino homepage. But there is still no such file after the installation.

So I will try your installation method and the bugfix. First of all I downloaded the arduino ide from the arduino Homepage (linux 64bit).

What do I have do now? (installation and bugfix).

---

By the way, shouldnt there be an official bugfix? Is it a problem for ubtuntu or arduino?
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 06, 2015, 02:34 pm
I think the apt-get install puts it in the /usr directory, but I'm not sure.

I think this one is Ubuntu's deal. If they did not change their startup script from the repository, then I point the finger at them. It can be easily corrected by the script edit.

edit: If Arduino doesn't release a version with the change to the startup script soon, then it will be their fault also.

It has been reported to the Arduino team here.
https://github.com/arduino/Arduino/issues/3081

I also added the fix for the bug to that issue.
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 06, 2015, 03:39 pm
Thank you for reporting that issue. How do I install arduino ide after I downloaded the installation file?
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 06, 2015, 04:25 pm
It isn't really a matter of installing it. I have several IDE versions on my Ubuntu box. I unpack them in /Downloads and they each end up in a directory "/Downloads/arduino-1.x.x".

Then I use Nautilus and navigate to that directory and right click on the arduino file located there and select "Make link". You can't move that script to your desktop, but you can move the link to your desktop and it will run from there. I rename that link to the arduino version, like "arduino-1.6.3" to identify which versions I have on my desktop.

Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: drmark666 on May 08, 2015, 08:38 pm
Regarding location of the file; if you enter
Code: [Select]
vi $(which arduino) to a terminal (or gedit, nano, or whatever instead of vi) it will find the one you actually use!
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 09, 2015, 01:00 pm
Now it works (now with 1.6.4)

I unpacked the arduino ide file and edited the 'arduino' script:

------------------------------------------------------------------

#!/bin/bash

CURDIR=`pwd`
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"

cd "$APPDIR"

for LIB in \
    java/lib/rt.jar \
    java/lib/tools.jar \
    lib/*.jar \
    ;
do
    CLASSPATH="${CLASSPATH}:${LIB}"
done
export CLASSPATH

export JAVA_TOOL_OPTIONS=""

LD_LIBRARY_PATH=`pwd`/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

export PATH="${APPDIR}/java/bin:${PATH}"

if [[ "$@" == *"--upload"* || "$@" == *"--verify"* || "$@" == *"--get-pref"* || "$@" == *"--install-board"* || "$@" == *"--install-library"* ]] ; then
   SPLASH=""
else
   SPLASH="-splash:./lib/splash.png"
fi

java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $SPLASH processing.app.Base --curdir $CURDIR "$@"

------------------------------------------------------------------

But there is still one thing that won't work: If I try to start arduino ide from the ubuntu file manger nothing happens (it seems to load as you can see by the courser, but the program doesnt start). If I start it with the tool 'krusader' (similar to total comander) arduino ide starts and works fine. Why is that?
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 09, 2015, 01:09 pm
Regarding location of the file; if you enter
Code: [Select]
vi $(which arduino) to a terminal (or gedit, nano, or whatever instead of vi) it will find the one you actually use!
When I still had arduino ide installed from the ubuntu shop your command gave me back the content of the 'arduino' script. Now that I deinstalled the shop version and run arduino ide as standalone from the original 1.6.4. package I only get the splash screen of that "VIM" command.

But as you can read above the problem seems to be solved for me. Thank you anyway!
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 09, 2015, 01:47 pm
The mod seems to cause a crash of my system.

When I start the moded arduino the program starts. Then I can browse trough the menu. But it looks kind of doubled (with transparent borders) and some submenus become scrollable. If I scroll the include library menu or the examples menu the whole system crashes and ubuntu goes back to login screen.

I removed the command line (export JAVA_TOOL_OPTIONS ...) and the error doesn't happen. If I add it again the error is reproduced.

This happens with arduino ide 1.6.4 and ubuntu 15.04
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 09, 2015, 02:05 pm
@agilus: Are you using the IDE from the Ubuntu repository?

edit: If so, don't! I found them quite buggy. Best is to download the IDE version for Linux from the Arduino website, either 32bit or 64bit depending on the Ubuntu OS you are running.

Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 09, 2015, 03:06 pm
No, it's arduino ide 1.6.4 64bit from the arduino website. Any idea?
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 09, 2015, 03:24 pm
How are you starting the IDE? It runs ok if you remove the added line? What does the command terminal show when you run the IDE from it? Open a terminal, navigate to the directory where you unpacked the IDE, then run it.
Code: [Select]
./arduino
Does it show that it is picking up the JAVA_TOOL_OPTIONS?

edeit: I have IDE v1.6.4 downloaded, and it runs fine with the added line.
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 09, 2015, 06:56 pm
I start it with Krusader. The ubuntu file manager wont start it (see my entry above).

Yes, without the edit line it runs fine. no ubuntu system crash. But still the crash of arduino when saving a file.

When I run the modded file terminal says:

PICKED UP JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar

When I run the original file it says:

PICKED UP JAVA_TOOL_OPTIONS:
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 09, 2015, 07:45 pm
Are you certain that is correct? Mine is backwards. When I run the modded file, the terminal says:
PICKED UP JAVA_TOOL_OPTIONS:
When I run the original file it says:
PICKED UP JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar


Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 10, 2015, 10:30 am
Sry, it is you said.

However there is still the system crash.

Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: agilus on May 11, 2015, 07:13 pm
Any idea?
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 11, 2015, 07:15 pm
No system crash here. Still working with the edited files.
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on May 12, 2015, 02:34 pm
I just received an email from the developer's list that the fix has been implemented to the Arduino's Linux shell script.
https://github.com/arduino/Arduino/issues/3081
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: rabBi7 on Jun 02, 2015, 05:54 pm
Regarding location of the file; if you enter
Code: [Select]
vi $(which arduino) to a terminal (or gedit, nano, or whatever instead of vi) it will find the one you actually use!
To add to this. If you are having trouble finding the file like I had. Type "sudo dpkg -L arduino" and all the files that are owned by arduino will be printed.

The arduino file is located here "/usr/bin/arduino" (for those who installed it with the Ubuntu package manager).
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on Jun 03, 2015, 04:26 am
I do not recommend using the Ubuntu package manager to install the Arduino IDE. It never has the current IDE version, and I have found their versions to be a bit buggy. I download my versions from the Arduino website.
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: jean_bruder on Jul 21, 2015, 11:34 am
I do not recommend using the Ubuntu package manager to install the Arduino IDE. It never has the current IDE version, and I have found their versions to be a bit buggy. I download my versions from the Arduino website.

Hi guys,

I'd like to know if somebody knows if some PPA repository could exist with the last version of the Arduino IDE, because I can't find any PPA including the latest version (1.6.4 right now) ?

This could help people to have always the latests development tools, which would help in hardware compatibility for example (I just expect to play with my new ESP8266 board, but have to upgrade manually the version of the IDE installed with the apt-get tools, which is really old : 1.0.5 ...).

Many thanks in advance,
Jean
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: SurferTim on Jul 21, 2015, 01:32 pm
Why not just download and unpack the latest version from this website?
Title: Re: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE
Post by: grizz3000 on Sep 06, 2015, 01:26 pm
The file edit worked for me.  Thanks!  Ugh, Vi, I don't miss those days, not one bit. :)