JCGO, a Java source to C code (java2c) translator, is an open-source software product developed and supported by Ivan Maidanski. With JCGO you could make your Java applications run faster, consume less system resources, harder to decompile and easier to deploy for the target platforms...
The following demo applications are converted from Java to C by JCGO.
filename | OS | CPU | C compiler | Garbage Collector | build command | speed gain, times | packed exe size, KiB | comment |
---|---|---|---|---|---|---|---|---|
GCBench.exe | Win32 | x86 | MinGW | BoehmGC | [3626] | 1.3 | 55 | |
CaffeineMarkEmbeddedApp.exe | Win32 | x86 | MinGW | BoehmGC | [3626] | 6 !!! | 60 | GCC has much higher optimization level than JIT |
scimark2.exe | Win32 | x86 | MinGW | - | [3625] | 1.55 | 60 | |
QSort.exe | Win32 | x86 | MinGW | - | [3625] | 1.2 | 30 | "quick-sort" benchmark |
The download link: SpeedTests-win32.7z.
Notes:
jcgo <AppMainClass> -src $~/goclsp/clsp_asc @$~/stdpaths.in
"
command;
-fprofile-generate
option and, after a test run, have been
recompiled with -fprofile-use
option (for better optimizations);
Some trivial console programs from the JCGO "examples" folder ("Empty1" - a do-nothing program just to show code size minimum; "ShowTZ" - shows the current GMT/local time and timezone/locale info).
filename | OS | CPU | C compiler | Garbage Collector | build command | packed exe size, KiB |
---|---|---|---|---|---|---|
hello.exe | Win32 | x86 | MinGW | - | [3613] | 13 |
hello.com | DOS | i8086 | Watcom | - | [2906] | 15 |
empty1.com | DOS | i8086 | Watcom | - | [2906] | 4.6 |
ShowTZ.exe | Win32 | x86 | MinGW | - | [3612] | 140 |
The download link: HelloWorld-win32.7z.
Notes:
jcgo <AppMainClass> -src $~/goclsp/clsp_asc @$~/stdpaths.in
"
command;
C:\JCGO\classpath-0.93\resource
") for accessing non-default
locale information.
"ShowProp" console sample program shows major Java system properties preset by the JCGO runtime depending on the execution environment.
filename | OS | CPU | C compiler | Garbage Collector | build command | packed exe size, KiB |
---|---|---|---|---|---|---|
ShowProp.exe | Win32 | x86 | MinGW | - | [3618] | 43 |
ShowProp-amd64.exe | Win64 | amd64 | mingw-w64 | - | [3905] | 150 |
ShowProp-djgpp.exe | DOS | x86 | DJGPP | - | [4310] | 105 |
ShowProp-dos16.exe | DOS | i8086 | Watcom | TinyGC | [2903] | 85 |
ShowProp-linux-x86 | Linux | x86 | GCC | - | [1009] | 50 |
ShowProp-linux-amd64 | Linux | amd64 | GCC | - | [1307] | 55 |
ShowProp-freebsd-x86 | FreeBSD | x86 | GCC | - | [1506] | 50 |
ShowProp-solaris-amd64 | Solaris | amd64 | Sun CC | - | [1806] | 220 |
The tar-ball download link: ShowProp-bin.tar.gz.
Notes:
jcgo -src $~/examples ShowProp -src $~/goclsp/clsp_asc @$~/stdpaths.in
"
command;
"ProGuard" and "JavaCC" are two samples of mature console applications.
application download filename | OS | CPU | C compiler | Garbage Collector | build command | exe size (unpacked), KiB | application download size, MiB | comment |
---|---|---|---|---|---|---|---|---|
proguard.exe | Win32 | x86 | MinGW | BoehmGC | [3620] | 1194 | 0.33 | stand-alone console executable (ProGuard v4.5 beta2 Java class file optimizer and obfuscator); see source code |
JavaCC-5_0-win32-jcgo.7z | Win32 | x86 | MinGW | - | [3614] | 1070 | 0.58 | the complete JavaCC v5.0 binary distributive pack (containing javacc, jjdoc, jjtree executables); see source code |
410 | ||||||||
908 |
Notes:
jcgo <AppMainClass> @$~/stdpaths.in
";
C:\JDK16\JRE
") for having access to the Java core classes
library;
Disk footprint comparison: the size of "proguard" packed stand-alone executable file is even a bit smaller than the size of the optimized, obfuscated (and packed) "proguard.jar" file.
These samples are based on the Eclipse SWT v3.6M4 GUI toolkit.
application download filename | OS | CPU | SWT back-end | build command | exe size (unpacked), MiB | application download size, MiB | start-up RAM usage, MiB |
---|---|---|---|---|---|---|---|
tuxguitar-1_2-linux-x86-jcgo.tar.gz | Linux | amd64 | gtk_64 | [1402] | 6.0 | 6.8 | 6 |
x86 | gtk | [1102] | 4.0 | 4 | |||
tuxguitar-1_2-windows-x86-jcgo.7z | Win64 | amd64 | win32_64 | [4002] | 5.6 | 5.6 | 20 |
Win32 | x86 | win32 | [3702] | 4.3 | 16 | ||
SWT_ControlExample-3_6M4-linux-x86-jcgo. | Linux | amd64 | gtk_64 | [1401] | 2.9 | 3.8 | 2 |
x86 | gtk | [1101] | 2.2 | 4 | |||
motif | [1201] | 1.9 | 1 | ||||
SWT_ControlExample-3_6M4-win32-jcgo.7z | Win64 | amd64 | win32_64 | [4001] | 2.8 | 2.2 | 12 |
Win32 | x86 | win32 | [3701] | 2.2 | 5 | ||
SWT_GraphicsExample-3_6M4-win32-jcgo.7z | Win64 | amd64 | win32_64 | [4001] | 1.5 | 1.7 | 8 |
Win32 | x86 | win32 | [3701] | 1.2 | 5 |
Notes:
The translation commands:
jcgo -src src;swt_src org.eclipse.swt.examples.graphics.GraphicsExample @$~/stdpaths.in
jcgo -src src;swt_src org.eclipse.swt.examples.controlexample.ControlExample @$~/stdpaths.in -rg org.eclipse.swt.widgets -rg org.eclipse.swt.browser.Browser
Some of the above SWT (and console) demo applications are also listed on the third-party sites introducing the competitive technologies and products, like:
Classpath "gtkpeer" AWT back-end is used for the following GUI applications.
application download filename | OS | CPU | build command | exe size (unpacked), MiB | application download size, MiB |
---|---|---|---|---|---|
J2dBenchmarkGUI-gtkpeer-linux-x86-jcgo.tar.gz | Linux | amd64 | [5301] | 4.7 | 2.9 |
x86 | [5201] | 3.2 |
Notes:
jcgo -src $~/goclsp/clsp_pgk -src $~/classpath-0.93/examples gnu.classpath.examples.java2d.J2dBenchmarkGUI @$~/stdpaths.in
These applications are using Sun J2SE v1.4 AWT/Swing GUI front-end.
application download filename | OS | CPU | sun-AWT build command | exe size (unpacked), MiB | application download size, MiB | start-up RAM usage, MiB |
---|---|---|---|---|---|---|
jEdit-4_2-win32-jcgo.7z | Win32 | x86 | [106] | 6.6 | 4.6 | 17 |
JDK_DrawTest-win32-jcgo.7z | Win32 | x86 | [107] | 1.8 | 1.1 | 4 |
JDK_Java2Demo-win32-jcgo.7z | Win32 | x86 | [103] | 5.2 | 3.6 | 23 |
JDK_JavaSound-win32-jcgo.7z | Win32 | x86 | [104] | 4.1 | 3.6 | 10 |
JDK_SwingSet2-win32-jcgo.7z | Win32 | x86 | [105] | 4.9 | 4.7 | 37 |
JDK_SwingSet2-linux-x86-jcgo.tar.gz | Linux | x86 | [305] | 5.0 | 7.0 | 4 |
JDK_SwingSet2-solaris-x86-jcgo.tar.gz | Solaris | x86 | [404] | 10 | 6.7 |
Notes:
Here are the links to some other projects that use JCGO to produce binary executables (see "Browse file for" or "Download" pages):