
This is just a really quick post to hopefully help anyone out that may be running into the same annoying problem I was with Flash CS4 and ActionScript 3 on Apple OS X (specifically 10.5).
I kept receiving the error pictured above, “Error initializing Java Runtime Environment. You may need to reinstall Flash,” whenever I would try to open a new ActionScript 3 project/file, or whenever I would try to run any AS3 code. The error didn’t occur when I was running ActionScript 2.0 projects.
After doing some searching on Google, and finding mostly solutions that were regarding the ‘CLASSPATH’ variable on Windows systems, it dawned on me that when I installed NetBeans IDE a few weeks back, it also installed a newer version of the Java Runtime Environment.
So I opened ‘Java Preferences.app’ which is installed in my ‘/Applications/Utilities/’ folder and found what I had suspected. My JRE was set to ‘Java SE 6.’

Apparently, Flash for some reason needs to run a 32-bit instance of JRE 5 on my machine when running ActionScript 3 code. This may be due to the fact I am running an older Intel Macbook Pro, or maybe Flash CS4 just needs an older version of Java. I honestly have no idea. But, after changing the Java Preferences to ‘J2SE 5.0 32-bit,’ Flash CS4 now runs without a hitch, and has no problem executing ActionScript 3. I do have to switch the preferences back to 6 when I run NetBeans, but that is fairly trivial using the Java Preferences panel.
If you don’t have ‘Java Preferences.app’ installed for some reason, you could try changing the preferred version manually from the command line by creating a symlink from ‘CurrentJDK’ to J2SE 5.0. However, I don’t recommend this route unless you know what you are doing.
Now, as I stated before, there are apparently several other issues that will also throw this same error (it’s pretty generic and unhelpful). This post isn’t intended to solve them all, but this is what worked for me. I hope it helps someone else and saves you a bit of a headache.
This entry was posted on Saturday, December 18th, 2010 at 11:18 pm and is filed under ActionScript, development, Flash, software, tutorial. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
hafi
Posted on February 12th, 2012 at 3:28 pm
hi,
thank you very much!
I found this post as soon as I started looking for a solution, and it worked like magic. you saved me a lot of trouble.
Thanks again!
hafi
Posted on February 12th, 2012 at 3:31 pm
by the way.
I use windows OS, so I removed the Java update through control panel – remove software, if it helps anyone.
Kevin deLeon
Posted on February 12th, 2012 at 3:38 pm
@hafi,
Glad to be of some help, and thanks for posting your Windows specific tip.