Go Down

Topic: Launch4j: An error occurred while starting the application. (Read 9193 times) previous topic - next topic


Just bought my first Arduino tonight (Osepp Uno R3 Plus) installed the software, drivers and uploaded the 'blink' sketch several times with different values.   I tried to import a library of sketches for the tutorial book and arduino.exe crashed.  When I tried to start it up again, I got the l4j error.  Win7.  I've tried version 1.0.5 as well as 1.5.5, using provided java and system java, deleted the preferences.txt file, edited preferences.txt to set the editor language to 'en'...all the aforementioned on both versions of the software.

Here's my launch4j.log:

CmdLine:   C:\Program Files (x86)\arduino-1.5.5\arduino.exe --l4j-debug
WOW64:      yes
Working dir:   C:\Program Files (x86)\arduino-1.5.5\.
Bundled JRE:   java
Check launcher:   C:\Program Files (x86)\arduino-1.5.5\java\bin\javaw.exe (n/a)
64-bit search:   SOFTWARE\JavaSoft\Java Runtime Environment...
32-bit search:   SOFTWARE\JavaSoft\Java Runtime Environment...
Match:      SOFTWARE\JavaSoft\Java Runtime Environment\1.7
Match:      SOFTWARE\JavaSoft\Java Runtime Environment\1.7.0_45
64-bit search:   SOFTWARE\JavaSoft\Java Development Kit...
32-bit search:   SOFTWARE\JavaSoft\Java Development Kit...
Check launcher:   C:\Program Files (x86)\Java\jre7\bin\javaw.exe (OK)
Add classpath:   lib\pde.jar
Add classpath:   lib\core.jar
Add classpath:   lib\jna.jar
Add classpath:   lib\ecj.jar
Add classpath:   lib\RXTXcomm.jar
Add classpath:   lib\commons-codec-1.7.jar
Add classpath:   lib\commons-exec-1.1.jar
Add classpath:   lib\commons-httpclient-3.1.jar
Add classpath:   lib\commons-logging-1.0.4.jar
Add classpath:   lib\jmdns-3.4.1.jar
Add classpath:   lib\jsch-0.1.50.jar
Launcher:   C:\Program Files (x86)\Java\jre7\bin\javaw.exe
Launcher args:   -Xms128m -Xmx128m -classpath "lib;lib\pde.jar;lib\core.jar;lib\jna.jar;lib\ecj.jar;lib\RXTXcomm.jar;lib\commons-codec-1.7.jar;lib\commons-exec-1.1.jar;lib\commons-httpclient-3.1.jar;lib\commons-logging-1.0.4.jar;lib\jmdns-3.4.1.jar;lib\jsch-0.1.50.jar" processing.app.Base
Args length:   272/32768 chars

I tried turning on Java logging and tracing but not having luck with that - either I don't know where to look (C:\Users\username\AppData\LocalLow\Sun\Java\Deployment\log) or Java's not logging.  Not bringing up the Java console either.

Anyone have any suggestions?  So bummed that I got to play for 10 minutes and then bang my head against the wall for 5 hours.


1. Delete the "arduino" folder from "My Documents".
2. Restart your PC.
3. Open arduino.
It will resolve the issue.

Kindly let us know after trying the tweak if the issue is solved or not. It should be successful, or you should update or reinstall JAVA. In 90% cases deleting the arduino folder fixes the issue...
All the best.
"Imagination is more important than knowledge."


Thanks.  That sounded like it would work especially since there was a directory under there with part of the library I tried to install.  So I deleted "My Documents\Arduino" and tried restarting the app.  This has brought a different problem to light, and quite possibly the root of my problem.  Both versions (1.0.5 and 1.5.5) created a looped directory structure:


All but the first couple are timestamped last night, even though I supposedly deleted that branch starting at the top.  I've tried for 15 minutes now and can't get that directory structure to go away.  Funny how the system integrity tools I've run recently don't pick that loop up.  Maybe Safe Mode might help.


Problem resolved.  Post-trama forensics showed that the failed sketch library import somehow caused a directory infinite loop.  I tried to remove the directory(ies) to no avail then I hit on the solution - I renamed the bad directory.  'arduino' now starts up quite nicely.

Muchos thanks to nightcrawler218 for the spot-on fix.



as stated in another thread i also suffer from lauch errors when trying to use the 1.5.5 branch.
I stumbled over this thread afterwards and tried to fix the issue by removing the arduino folder (including reboot) as well but with no success.
1.0.5 launches fine (as did 1.5.4r2 in the past), but 1.5.5 still keeps freezing and popping up the launch4j error after about a minute.

the installed java version is 7 update 45


Problem resolved.  Post-trama forensics showed that the failed sketch library import somehow caused a directory infinite loop.  I tried to remove the directory(ies) to no avail then I hit on the solution - I renamed the bad directory.  'arduino' now starts up quite nicely.

Muchos thanks to nightcrawler218 for the spot-on fix.

You're always welcome brother...
"Imagination is more important than knowledge."


Here's how i REALLY fixed mine after so much troubleshooting!
Today was my first day of my Arduino Uno R3 or any MicroController all i am is a Hard Core Gamer
but now i decided to do this, so heres how it happened all today.

Firstly I downloaded the Arduino software from a link i found on a forum while searching "Setup Arduino Uno" Arduino ERW (IDE) software from their website (www.arduino.cc) and installed it onto my Windows 7 32-bit System.

Then a problem occurred;
I tried to open/run the Arduino ERW Software then i got the error message: An error occurred while starting the application arduino
... i tried everything to get it working, i went on the Arduino site and found a "solution" which said to run "arduino.exe --l4j-debug", never worked.

i also tried Running as Administrator, and Running in compatibility for Windows XP and... never got anywhere!

This is what solved my Arduino Crash at start problem: How i fixed it, all i had to do was select Run program in compatibility for "Windows 2000" AND IT WORKED!!! I WAS SO HAPPY!!!! Ah, thank god it worked.



glad it worked for you.
Unfortunately, there is no Win2k compatibility option on my Win8.1 x64 setup, so i cant test your fix.
No compatiblity option available fixed it for me (win 8, win 7, vista, xp, not even 98/me).

So after all, still no way to get the 1.5.5 build running on my machine :( and i still havent found any reasonable explanation or any estimation when this issue might be adressed...



Hi Max,
I'm sorry to hear your arduino isn't working
Its really depressing.

But why not downgrade from 8.1 to Windows 7 ?

Since you're using 8.1 which isn't that old, you couldn't have setup too many things to depart with on your system.

It'll be a small job downgrading to Windows 7
There are 2 solutions to this:

1: Downgrade to Windows 7 and run the Arduino program in Windows 2000 Compatibility mode

2: Download a Linux live disk, and it'd do just well enough for running Arduino (this is what i had in mind when i wasn't able to get my Arduino software working), Here is a link to the Linux Disk you can get: http://linuxos.co.za/index.php?route=product/product&product_id=91 or download it at http://www.linuxmint.com/download.php
once you Install or Boot up from the live disk, everything is pretty simple, just download the Linux Version of Arduino here: http://arduino.cc/en/Main/Software

Hope i helped




well, im surely not downgrading an otherwise perfectly working system just for the 1.5.5 beta.

Yes, the features of the 1.5 branch sound nice, but since 1.54r2 works on all machines including the ones where 1.5.5 refuses to load it is hardly solely the systems fault, isnt it? In fact, i just downloaded the 1.54r2 archive from the prevrious releases page, unzipped it and launched it -> runs perfectly!

the thing is NOT to know whats causing the launch error and java freeze (each launch attempt results in a frozen (and idle) arduino process and an additional java process that uses several percent cpu time. after a few launch attempts i wondered why my fans started getting louder but i didnt immediately see any reason. active apps only used minimal resources, then i changed sort order by cpu and found 4 java processes from the previous arduino launch attempts using almost 100% cpu in total.

one of the things that i dislike about the 1.0 branch is the bad menu mechanism. since im trying a lot of different things i have q ton of examples and supplied sketches from installed libraries. scrollable menus from the 1.5 branch really sounded like a nice feature.

anyway, it would just be nice to know whats causing these weird problems, even if it would take some time to get a fix for it. not knowing whats wrong and not seeing any sign of investigation in this matter according to the number of related topics in this forum is a bit sad tbh.

for now i'll try to keep up the faith and use 1.0.5 as long as neccessary, but seeing the 1.5 branch going towards "stable" and "recommended" soon would really be nice ;)



FWIW, I think it is somehow related to the setup and "work" directories/files.  I tried pretty much everything mentioned here and in other forums without luck.
Then I went to the next phase and nuked out all Java pointers/references in the registry, and still no-go.

Coincidentally, what finally seemed to do it was this:

1. left arduino-1.5.5 as is unzipped from the download ZIP in a dir  (c:\arduino-1.5.5)
2. downloaded the latest 1.5.4r and unzipped that to c:\arduino-1.5.4r
3. ran the 1.5.4 version, and just saved the default boilerplate sketch that is created by default, as a new sketch. This goes into Documents\Arduino\etc etc etc
4. closed 1.5.4, then reopened it and reloaded the sketch
5. closed 1.5.4 again
6. opened 1.5.5

...which now loads fine

I am in the process of investigating exactly WHICH of the above steps is of the essence, and what exactly it did while loading 1.5.4 to make the environment "right"

hope this anecdotal data helps someone in the meantime


p.s. on a philosophical note, I don't think - *in general* - that it's really good advice to tell anyone "you should switch your operating system" in order to solve an issue like this.  Windows is claimed supported by Arduino IDE, and this 1.5.5 problem is quite clearly a regression. So while I can understand the pragmatism of the advice in order to "just get it working", I personally find it a bit irritating when this kind of "logic" is applied en-masse.
We don't go cutting down forests to prevent forest fires, now do we?

Go Up