# VTCC **Repository Path**: mirrors_miho/VTCC ## Basic Information - **Project Name**: VTCC - **Description**: Compile and Run C code from Java via embedded Compiler (Works on Linux, Windows and macOS) - **Primary Language**: Unknown - **License**: BSD-2-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-10-22 - **Last Updated**: 2026-03-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # VTCC [ ![Download](https://api.bintray.com/packages/miho/TCC/VTCC/images/download.svg) ](https://bintray.com/miho/TCC/VTCC/_latestVersion) [![Build status](https://ci.appveyor.com/api/projects/status/862o08c4bwgdyafp?svg=true)](https://ci.appveyor.com/project/miho/vtcc) [![Build Status](https://travis-ci.org/miho/VTCC.svg?branch=master)](https://travis-ci.org/miho/VTCC) Compile and Run C code from Java via embedded [TCC](https://bellard.org/tcc/) Compiler (Works on Linux, Windows and macOS) ## Usage: To execute C code, the following method can be used: ```java // execute C code" String code = "#include \n" + "int main(int argc, char* argv[]) {\n" + " printf(\"Hello, World!\\n\");\n"+ " return 0;\n"+ "}"; CInterpreter.execute(code); ``` To execute a specified C script, use: ```java // execute main.c CInterpreter.execute(new File("main.c")); ``` To print the output to given print streams, use the `print(...)` method: ```java // execute main.c CInterpreter.execute(new File("main.c")).print(System.out,System.err); ``` To wait until the execution has finished, use the `waitFor()` method: ```java // execute main.c and wait until exution finishes" CInterpreter.execute(new File("main.c")).waitFor(); ``` The exit value can be accessed via: ```java // execute main.c CInterpreter.execute(new File("main.c")).getProcess().exitValue(); ``` To destroy the current process, the `destroy()`method can be used: ```java // execute main.c CInterpreter.execute(new File("main.c")).destroy(); ``` ## How to Build VTCC ### Requirements - Java >= 1.8 - Internet connection (dependencies are downloaded automatically) - IDE: [Gradle](http://www.gradle.org/) Plugin (not necessary for command line usage) ### IDE Open the `VTCC` [Gradle](http://www.gradle.org/) project in your favourite IDE and build it by calling the `assemble` task. ### Command Line Navigate to the [Gradle](http://www.gradle.org/) project (e.g., `path/to/VTCC`) and enter the following command #### Bash (Linux/OS X/Cygwin/other Unix-like Shell) sh gradlew assemble #### Windows (CMD) gradlew assemble