Go Down

Topic: [SOLVED]Ubuntu V15.04 Save As selection crashes IDE (Read 9351 times) previous topic - next topic

SurferTim

Apr 25, 2015, 08:40 pm Last Edit: Apr 25, 2015, 10:33 pm by SurferTim
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.

SurferTim

#1
Apr 25, 2015, 10:32 pm Last Edit: Apr 25, 2015, 10:42 pm by SurferTim
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 "$@"

agilus

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

SurferTim

#3
May 05, 2015, 09:44 pm Last Edit: May 06, 2015, 12:17 am by SurferTim
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.




siriusjbw

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

SurferTim

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/


agilus

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?

SurferTim

#7
May 06, 2015, 02:34 pm Last Edit: May 06, 2015, 03:00 pm by SurferTim
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.

agilus

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

SurferTim

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.


drmark666

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!
Mark

agilus

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?

agilus

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!

agilus

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

SurferTim

#14
May 09, 2015, 02:05 pm Last Edit: May 09, 2015, 02:14 pm by SurferTim
@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.


Go Up