C to java converter source code
Active 11 years ago. Viewed 3k times. Preferably the code should function the same!! But I at least want the tool to make an attempt!
I think your question title is backwards If you can read Java, you can probably read C enough for your purposes. Areas where you might have to learn more pointers etc don't have a proper translation into Java anyway so your translator wouldn't help much there.
Show 6 more comments. Active Oldest Votes. A few example: C does not support classes, but classes are a fundamental concept of Java. C has a huge pointer syntax, Java doesn't.
Computerish Computerish 9, 7 7 gold badges 35 35 silver badges 47 47 bronze badges. I've updated with a screenshot with errors I get when I try with c2j. Add a comment. If you want to run it as Java you will have to have a JVM! Tangible Software Solutions.
Contact Testimonials Purchase Download Converters. Converters Purchase Contact. Key Benefits Saves valuable time Accurate and comprehensive Safe - your code never leaves your machine Responsive customer support Numerous conversion and formatting options. Easy to use 15 day money-back guarantee Helpful conversion comments Excellent tools for learning new languages Tens of thousands of lines converted per minute.
Please Sign up or sign in to vote. See more: Java. Copy Code. Posted Nov am mohamedokily. Add a Solution. Instance Nov am. Like this? CPallini Nov am. Where is the trouble, on Java or C side?
Top Rated Most Recent. Accept Solution Reject Solution. C code and Java are quite different and you would need to rework it substantially. JCGO translator uses some optimization algorithms that allow, together with optimizations performed by a C compiler, the resulting executable code to reach better performance if compared with the traditional Java implementations based on the Just-In-Time technology.
The produced executable does not contain nor require a Java Virtual Machine to execute, so its resource requirements are smaller than that required by a typical Java VM. This also simplifies the process of deployment and distribution of an application.
In addition, the produced native code is highly resistant to reverse engineering and tampering. JCGO at a glance Producing a native executable file for your Java application is done in three steps with the JCGO application: generation of C code files from Java source files, compiling these C code files into one or more machine-dependent object files, and linking them all together with C library into a binary executable file.
This transformation is performed on the developer's system, which may differ from the target system of your application. If you need to pack any resource files only the standard Java property file into your application then you should convert these resource files into the corresponding Java source files a special stand-alone utility is supplied within the JCGO application to automate this conversion beforehand and pass them too as an input to the JCGO translator.
Since JCGO generates platform-independent C code and uses only a small cross-platform portable set of the standard C library functions, there is a large number of platforms supported - based on different CPU architectures e. By using the desired C compiler toolkit, you compile the generated C code files all at once as a single compilation unit or each file separately for your Java application together with the JCGO-specific C part of Java runtime.
A lot of C macros are provided to customize the compilation process and the resulting executable. Besides, a typical C compiler offers a good set of options to control code optimization and debugging support features. The linkage step for your application is done by the desired C compiler toolkit in the same way as for a normal C program except that a precompiled Garbage Collector library either static or dynamic is linked with it too.
JCGO does not support Java exception stack tracing. JCGO optimization techniques JCGO translator itself performs at least the following local and global optimizations: - unused class, methods and fields elimination; - marking suitable methods for inlining; - turning virtual calls into direct ones; - turning all interface method calls into either virtual or direct ones; - fields, local variables and parameters reordering; - runtime checks for null pointer, array index, cast type elimination; - on-the-stack object allocation; - performing class initialization at program start-up; - removing unused class meta-information for "Reflection" API; - packing characters of Latin-1 strings into byte arrays; - putting static arrays into program image data sections; - putting strings, classes and immutable arrays into program image read-only section.
The further optimizations of the code are done by the C compiler you use. These advantages identify, in fact, the goals that may be achieved by applying the JCGO to your application.
0コメント