Haxe requires Java 6 (not sure) The latest as of now (Feb 22, 2019) is Java 8 update 201
Because of Security fixes and new Java features Java 8 or later is recommended.
Select the Java build that fits your platform and OS.
For desktop platforms:
Please install the Java Runtime Environment (JRE) and the Software Development Kit (SDK).
The Java SDK includes the javac compiler that converts .java files into a .jar file.
Android for example has Java already installed.
Android Studio would be recommended there.
NOT SURE if Haxe can generate .java code that will run on an Android platform.
Make your choices when running the Java installer.
After install open Cmd.exe window (or your favorite shell) and type
You will see several short descriptions of command line options for Java. Or type
and you will see (example from Windows 64 bit)
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
Followed by several short descriptions of command line options for Java.
Install Haxe and Java support library hxjava
Using Haxe to compile to Java
Haxe puts all of your Haxe sources and also sources for any Haxe libraries
changed to various .java files
into a src subdirectory of a directory you give.
Example, change to fit your needs.
haxe -lib haxe-strings -cp src -java C:/Programming/Haxe/My_Project/Java_OUT -main Main
Please notice that a Java_OUT directory is used to hold the src directory of the java files.
Having Haxe output each language in a separate directory allows for easier management.
Running Java Programs
If you used a separate directory, the below will work.
java -jar Main.jar
Debugging Java Programs
IntelliJ Community Edition 2018.3
Somewhat biased article
INCORRECTLY states that only JRE is needed.
javac is needed to built a .jar file
The SDK has javac and not the JRE
Has mostly better information with some good Tips on how to fix problems of install and setup.