J2C Java to C++
Checks Java 17 code for C++ translation problems and translates it to C++20
- Pricing
- Open source
- Platforms
- CLI, vscode, Windows
- Runs
- Locally
- Version
- 0.6.1
- Listing updated
- today
Similar MCP servers
About J2C Java to C++
J2C Java to C++ is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
J2C is a source translator from Java to C++, and this server wraps it for MCP clients over stdio, published on npm as @juangp3/j2c-mcp. It is a modernized continuation of arnetheduck's j2c, packaged with a command-line translator and a VS Code extension.
The README is explicit that it is a preview: it is not a complete Java compiler or runtime, feature support is incremental, and generated C++ may need manual changes. A check mode lists every compile error and unsupported construct as file:line messages without writing files. A run command translates, builds, runs the C++ program and the same class on the JVM, then compares output, error stream and exit code. Maven and Gradle projects are detected and their class paths resolved. Sealed types translate to ordinary inheritance, and C++ does not enforce Java's permits restriction unless you choose reject mode.
The translator needs Java 11 or newer and a C++20 compiler for the generated Makefiles.
Install
Run in a terminal
claude mcp add j2c -- npx -y @juangp3/j2c-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"j2c": {
"command": "npx",
"args": [
"-y",
"@juangp3/j2c-mcp"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"j2c": {
"command": "npx",
"args": [
"-y",
"@juangp3/j2c-mcp"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"j2c": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@juangp3/j2c-mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"j2c": {
"command": "npx",
"args": [
"-y",
"@juangp3/j2c-mcp"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"j2c": {
"command": "npx",
"args": [
"-y",
"@juangp3/j2c-mcp"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
What it does
- Translation check
- Lists unsupported constructs and compile errors per file and line without writing output.
- Java to C++20
- Translates source files or whole directories into C++.
- Run and compare
- Builds the C++ output and compares it with the JVM run.
- Maven and Gradle detection
- Finds source roots and resolves class paths from the build.
- Bundled runtime
- Includes a Java runtime library for translated code.
- Sealed type policy
- Choose advisory comments or reject sealed declarations.
Good for
- Find out which Java constructs block a C++ port
- Translate a Java utility library to C++20
- Verify translated output matches the JVM's behaviour
- Check a Maven module before starting a port
Pricing
Open source
J2C Java to C++ FAQ
Does it translate any Java program?
No. The README calls it a preview; generated C++ may need manual changes and JVM semantics may not all be preserved.
What do I need installed?
Java 11 or newer to run it and a C++20 compiler for the output.
How are sealed classes handled?
As ordinary C++ inheritance with comments listing permitted subtypes, or rejected with the reject option.
How is it installed as an MCP server?
As the npm package @juangp3/j2c-mcp over stdio.
Is J2C Java to C++ free?
Yes. J2C Java to C++ is open source, so you can use and self-host it for free.
How do I add J2C Java to C++ to Claude Code?
Run this command in your terminal: claude mcp add j2c -- npx -y @juangp3/j2c-mcp
What are the best alternatives to J2C Java to C++?
The closest alternatives to J2C Java to C++ are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.
Where this comes from
- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.


