[SOLVED]Ubuntu V15.04 Save As selection crashes IDE

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.

hs_err_pid4992.txt (94.6 KB)

I found a solution by editing the arduino shell script. Look below to see where to insert the "export JAVA_TOOL_OPTIONS" environment variable.

#!/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 "$@"

Hi, could you please tell me which file I have to edit and where it is located? I cannot find it. thx

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. :frowning:

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:

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.

I was having the same problem, and I can't find the directory with the shell script.
Where is this directory?

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/

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?

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.

I also added the fix for the bug to that issue.

Thank you for reporting that issue. How do I install arduino ide after I downloaded the installation file?

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.

Regarding location of the file; if you enter vi $(which arduino) to a terminal (or gedit, nano, or whatever instead of vi) it will find the one you actually use!

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?

drmark666:
Regarding location of the file; if you enter 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!

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

@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.

No, it's arduino ide 1.6.4 64bit from the arduino website. Any idea?

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.

./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.

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:

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

Sry, it is you said.

However there is still the system crash.