Install/Usage Overview

You can use JUnion:

Source Translator

You can compile java source with junion with the following command:

java -jar junionc1.0.jar -classpath lib/junion1.0.jar -version 1.8 -sourcepath src -outputpath out


Javac plugin

You can compile JUnion project directly with javac 1.8, by adding a command line argument: -Xplugin:junion. Make sure all the referenced libraries are on the classpath.

Eclipse plugin

To use JUnion within Eclipse IDE, follow the steps:

  1. Open Eclipse
  2. Help -> Install New Software
  3. Enter eclipse update site:
  4. Select JUnion plugin and continue with the installation.

  5. Create new Java Project or Open existing one
  6. Add project runtime library: junion<version>.jar
  7. Create new file in the project named “.junion”
  8. In .junion property file, set property compileLibs= path to junionc<version>.jar
  9. Instead of step 4. you can add library junionc<version>.jar directly to your classpath. However it is not a runtime dependency.
  10. Save the file, this should automatically create the folder “.generated_src_junion” (If you do not see files beginning with a dot, your package explorer has a filter enabled)
  11. In project properties -> Java Build Path -> Sources -> Add Folder and add .generated_src_junion
  12. Window -> Preferences -> Java -> Compiler -> Error/Warnings -> Deprecated or Restricted API Set Forbidden Reference to Warning.

Alternatively watch the Eclipse Setup Tutorial:

Eclipse Installation Tutorial

Netbeans Support

To use JUnion within Netbean IDE, follow the steps:

  1. Add all the libraries to the project.
  2. Project Properties -> Build -> Compiling -> Disable Compile on Save and enter “-Xplugin:junion” in Additional Compiler Options


Gradle build file:

apply plugin: 'java'

repositories {
configurations {
dependencies {
    compile 'com.github.tehleo:junion:1.1.1'
    junion 'com.github.tehleo:junionc:1.1.1'
task junionTask(type: JavaExec) {
    classpath configurations.junion
    classpath += sourceSets.main.runtimeClasspath
    main = 'theleo.jstruct.plugin.SourceCompiler'
    args = ['-classpath', sourceSets.main.runtimeClasspath.getAsPath(),
            '-version', '1.8',
            '-sourcepath', files(,
            '-outputpath', file('build/generated').getPath()
    ] = ['build/generated']

build.dependsOn junionTask


Maven build file:

<project xmlns="" xmlns:xsi="" xsi:schemaLocation="">



 	 <name>Hello Structs</name>