Skip to content
Yann GEFFROTIN edited this page Aug 27, 2025 · 4 revisions

Table of Contents

Description

Java is required for AS3 compilation with Flex SDK, AIR SDK or Apache Flex SDK and some other AS3 related tools. Also JavaScript compilation with closure compiler requires Java as does some other misc. tools in FlashDevelop depending on your target platform, as for example ANT.

Installing

You need to install 32-bit Java 1.6+ and add Java path to your PATH environment variable, JAVA_HOME environment variable or to bin/jvm.config or build.properties file in the SDK. Generally speaking the new AIR SDK with ASC 2.0 should work with any 32-bit Java and Flex SDK (Apache too) requires 1.6+ 32-bit Java with few errors that may need a workaround.

Path resolution

Go into Advanced System Settings.

FlashDevelop resolves Java binary (java.exe) location and arguments the following way:

1. Looks inside the SDK for bin/jvm.config or build.properties file to get user-defined arguments:

  • java.home: Path to Java installation, ie. "C:\Program Files (x86)\Java\jre6" without "\bin" at the end.
  • java.args: Arguments to call Java (ie. how much RAM to assign etc.)
2. Looks for JAVA_HOME environment variable. Path to Java installation, without "\bin" at the end.

3. Calls the default Java executable in the PATH environment variable. You should add Java bin directory,
ie. "C:\Program Files (x86)\Java\jre6\bin", to your PATH environment variable.

4. Restart the operating system to ensure the changes take effect.

Possible errors

Error when compiling:

 Error: null

Reason: An unknown error has been encountered in the compiler.

  • Fix: Incremental compilation in Flex SDK + AIR SDK 16+ is broken with Java 8: Use Java 6 or Java 7.
  • Fix: Clean the project with Shift+F8 and rebuild.
Error when compiling:
 Error: Comparison method violates its general contract!

Reason: Comparison error has been encountered in the compiler.

  • Fix: With Java 7 and Flex SDK you need to add "-Djava.util.Arrays.useLegacyMergeSort=true" to bin/jvm.config or build.properties file to workaround breaking change with array sorting in Java 7.
  • Fix: Find the possibly failing comparison part from your code and fix it. Example case:
    https://github.com/Gamua/Starling-Framework/issues/379
Error when debugging:
 System.DllNotFoundException: Unable to load DLL 'jvm.dll'.

Reason: Java can't find the necessary dependency DLLs.

  • Fix: Point the correct Java to the SDK as specified in the first chapters.
Error when debugging:
 System.BadImageFormatException: An attempt was made to load a program with an incorrect format.

Reason: You have incorrect version of Java installed or wrong Java is pointed to the SDK.

  • Fix: Install correct Java and/or point the correct Java to the SDK as specified in the first chapters.

Source

  • https://web.archive.org/web/20210413090039/https://www.flashdevelop.org/wikidocs/index.php?title=Java
Clone this wiki locally