Check Java 17 code for C++ translation problems, fix them, and translate it to C++20.
MCPpedia last refreshed this data
io.github.juangp3/j2c is an MCP server that check Java 17 code for C++ translation problems, fix them, and translate it to C++20. Its tool list has not been published yet over stdio, sse and http, requires no API key, and scores 60/100 on MCPpedia's security, maintenance and efficiency rubric.
Config is the same across clients - only the file and path differ.
{
"mcpServers": {
"io-github-juangp3-j2c": {
"args": [
"-y",
"@juangp3/j2c-mcp"
],
"command": "npx"
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
Check Java 17 code for C++ translation problems, fix them, and translate it to C++20.
This server supports HTTP transport. Be the first to test it - help the community know if it works.
Five weighted categories - click any category to see the underlying evidence.
No known CVEs.
Checked @juangp3/j2c-mcp against OSV.dev.
Be the first to review
Have you used this server?
Share your experience - it helps other developers decide.
Sign in to write a review.
Others in writing
Scrape, crawl, and map websites to Markdown or JSON via local CLI.
Create and edit PDFs: text, Markdown, tables, metadata and pages, with Japanese font embedding.
一键同步文章到多个内容平台,支持今日头条、WordPress、知乎、简书、掘金、CSDN、typecho各大平台,一次发布,多平台同步发布。解放个人生产力
Documents to Markdown for agents: PDF layout, tables and OCR, Office, HTML, scans. docling in Rust.
MCP Security Weekly
Get CVE alerts and security updates for io.github.juangp3/j2c and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
J2C translates Java source code to C++. This repository packages the standalone command-line translator and the J2C Java to C++ VS Code extension. It is a modernized continuation of arnetheduck/j2c, whose original Eclipse plugin remains in that repository.
Preview: J2C is a source translator, not a complete Java compiler or runtime. Java feature support is incremental. Generated C++ may need manual changes and a compatible implementation of Java runtime behavior. Do not assume that arbitrary Java programs compile or preserve all JVM semantics.
Build the executable JAR from the repository root:
mvn package
Create an output directory and translate a Java file or source directory:
mkdir generated
java -jar target/j2c-cli.jar \
--output generated \
--sourcepath test/src \
test/src/se/arnetheduck/j2c/test/Hello.java
Use the platform path separator between multiple source roots or classpath
entries (; on Windows, : on macOS/Linux). Source paths help resolve Java
source dependencies; classpath entries should identify dependency JARs or
class directories. If --sourcepath is omitted, J2C infers roots from the
selected inputs.
The --sealed-types policy defaults to advisory. Sealed declarations are
translated using ordinary C++ inheritance and generated comments list
permitted direct subtypes; C++ does not enforce Java's permits restriction.
Choose --sealed-types reject to stop translation when sealed or non-sealed
declarations are encountered.
Additional optional arguments are --classpath <paths>, --name <name>,
--sealed-types advisory|reject, and --encoding <charset>. Java sources are
read as UTF-8 unless --encoding says otherwise; generated C++ is always
written as UTF-8.
Translate against the J2C runtime so the program runs without writing any C++:
java -jar target/j2c-cli.jar --runtime bundled --output generated test/runtime/hello
make -C generated all mains && generated/bin/Hello
--runtime bundled uses the runtime packaged in the CLI JAR (and in the VS
Code extension), so no repository checkout is needed: on first use it is
extracted to ~/.j2c/cache/runtime-<version>-<hash> (or J2C_CACHE_DIR),
reused while its files are intact, and replaced when they are not.
--runtime <directory> uses another runtime directory, such as a checkout's
runtime/ (name a directory called bundled as ./bundled). Without
--runtime, the default, java.* comes from the running JDK and every JDK
class is a stub that fails at run time; with it, java.* comes from the
runtime, so JDK classes it does not provide are compile errors that
--check lists. See runtime/README.md for what it
covers.
j2c run translates, builds and runs a program in one step, runs the same
main class on the JVM, and compares the two:
java -jar target/j2c-cli.jar run --output generated test/runtime/hello -- one "two words"
java -jar target/j2c-cli.jar run --output generated --format json --main Stdin --stdin test/runtime/stdin/input.txt test/runtime/stdin test/runtime/hello
It translates against the runtime (--runtime, default bundled) with
--line-directives, builds the main class's binary (make bin/<Class>, run
as j2c build runs make, so a failed build reports the compiler's errors
at their Java lines), runs it in a fresh working directory with the
arguments after -- and the bytes of --stdin <file> as standard input,
compiles the same sources with the javac of the JDK running J2C, and runs
the class with java (in WSL when the build ran there: --java <program>,
else J2C_WSL_JAVA, else java on WSL's PATH, else the Wind