原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

J2C Java to C++

作者:juangp3版本 0.6.1i★ –i在你的电脑上运行
注册名称io.github.juangp3/j2c

安装

概览

作者提供的说明(英文原文)

Check Java 17 code for C++ translation problems, fix them, and translate it to C++20.

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 其他

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

  • 基础检查:1 项中通过 1 项
  • 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
  • 注册中心没有列出需要填写的密钥。

你需要

  • npm已安装 Node.js(用于 npx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "j2c": {
      "command": "npx",
      "args": [
        "-y",
        "@juangp3/j2c-mcp",
        "--root",
        "."
      ]
    }
  }
}

在终端中运行这条命令

claude mcp add j2c -- npx -y @juangp3/j2c-mcp --root .

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "j2c": {
      "command": "npx",
      "args": [
        "-y",
        "@juangp3/j2c-mcp",
        "--root",
        "."
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "j2c": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@juangp3/j2c-mcp",
        "--root",
        "."
      ]
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月6日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 juangp3 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“其他”中的其他服务器比较i

  • 星标数多于此分类中其他 32531 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 32531 个服务器的 78% 更新
  • 基础检查结果等于或优于此分类中其他 32531 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

J2C Java to C++ 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(0.6.1)于10天前进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。

有什么可以替代它?

同一分类中有:Spec Driven Development, Remote Desktop Commander, Reelsaw

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Spec Driven Development

作者:formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

在你的电脑上运行★ 440MIT14个月前更新
安装

Remote Desktop Commander

作者:desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

在云端运行★ 211昨天更新
安装

Reelsaw

作者:osbytes

Drive a self-hosted Reelsaw: turn long videos into vertical clips, edit, re-render and export them.

在你的电脑上运行今天更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

J2C Modern Edition

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.

Requirements

  • Java 11 or newer to run the CLI and VS Code extension.
  • Maven to build the CLI from source.
  • A C++20 compiler for generated Makefiles and C++ output.
  • Node.js 22 or newer and npm to package the VS Code extension.

CLI

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 , --name , --sealed-types advisory|reject, and --encoding . 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- - (or J2C_CACHE_DIR), reused while its files are intact, and replaced when they are not. --runtime 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/ , 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 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 , else J2C_WSL_JAVA, else java on WSL's PATH, else the Windows JDK running J2C, with a note). It compares standard output, standard error without the JVM's stack frames, and the exit code, and prints the C++ program's output, how each run ended and the first line that differs. --main chooses among several classes with a main method, --no-compare only runs the C++ program, --timeout (default 60, 0 for none) stops each run and everything it started, and --output-limit (default 20000) caps the output reported for each stream. With --format json the result has status (ok, differs, failed, crashed, timeout or build-failed), cpp and jvm (exit code, signal, timedOut, durationMillis, stdout and stderr with their byte counts and whether they were truncated), comparison (equal, differs or skipped, with firstDifference of each stream: line, cpp and jvm) and build.

Check whether code can be translated before writing anything:

java -jar target/j2c-cli.jar --check --sourcepath src/main/java src/main/java

--check takes the same inputs as a translation but no --output. It prints every compile error and unsupported construct in the selected files as file:line: message, followed by a summary per kind, and writes no files. Select a source root to check a whole project. --version prints the CLI version.

Maven and Gradle projects

Pass a project directory (one with a pom.xml, build.gradle(.kts) or settings.gradle(.kts)) and J2C sets itself up from the build:

java -jar target/j2c-cli.jar --check .

java -jar target/j2c-cli.jar --tests --output generated .

  • Source roots: Maven's src/main/java (or ) of every module listed in , plus roots added by build-helper-maven-plugin; Gradle's src/main/java of the root project and each included subproject, or the source sets Gradle reports. With --tests, the test roots (src/test/java, ) too.
  • Class path: J2C runs the project's wrapper (mvnw, gradlew) or else mvn/gradle from the PATH. Maven runs dependency:build-classpath (compile scope, or test scope with --tests); in a multi-module build whose modules depend on each other it also runs the compile phase with compilation skipped, so plugins bound to earlier phases run. Gradle gets an init script (--init-script) that prints compileClasspath and testCompileClasspath, retried with --offline if it fails. The build may download dependencies. Other modules' output is left out, because their sources are translated.
  • What was detected, and the command run, is printed to stderr, and is in the JSON output as projects. Resolved class paths are cached in ~/.j2c/cache (or J2C_CACHE_DIR), keyed by a hash of the build files.
  • If the tool is missing or fails, J2C still uses the source roots and reports the warning J2C-PROJECT-CLASSPATH-UNRESOLVED (in warnings in JSON); dependency types then fail to resolve.

--no-build-tool never runs Maven or Gradle (a cached class path is still used). --project none turns detection off, and --project uses that directory's build for other inputs, such as one file in it. Detection only looks at the input directories themselves, never at their parents.

The output directory must be empty or earlier J2C output, which is marked with a .j2c-output file. Translation first moves the directory's current contents to a backup in the temporary folder, so J2C refuses other non-empty directories unless you pass --force. Every selected file is checked before that: when one has problems, the translation fails with all of them and leaves the directory as it was. The build's objects and libraries (obj/ and bin/) stay, and a generated file that comes out the same keeps its earlier modification time, so make (and j2c build, j2c run and j2c test) compiles again only what changed: after the first build, a run against the runtime no longer compiles it all again. Changing the compiler or its flags (CXX, CFLAGS) compiles everything again.

Files that are only dependencies (found on the source path, not selected) and do not compile are translated like library classes, as a header and stubs without an implementation, with the warning J2C-DEPENDENCY-ERRORS (in warnings in JSON) instead of an error.

Each problem has a stable ID (such as J2C-LAMBDA-ANONYMOUS-THIS). j2c explain describes it and how to fix it; j2c explain lists them all. --format json makes translation and --check print a single JSON object (problems with ID, file, line, column, message and hint; or the generated files). j2c capabilities prints the supported features and limitations as JSON.

Some problems have a mechanical fix, which j2c fix makes in the Java source:

java -jar target/j2c-cli.jar fix src/main/java           # preview as a unified diff

java -jar target/j2c-cli.jar fix --apply src/main/java # write the fixes

It takes the same inputs and options as --check (except --output, --name and --force). The preview prints a diff on stdout that git apply accepts; --apply writes the fixes, checks again, and repeats until no fixable problem is left. Fixes exist for J2C-LAMBDA-ANONYMOUS-THIS (a var self = this; local used in the lambda), J2C-LAMBDA-INTERFACE-SUPER (the Iface.super.m() call moved into a private method), J2C-PATTERN-OUTSIDE-METHOD (the field initializer moved into a private method), J2C-TEST-TIMEOUT (the timeout removed) and J2C-TEST-PRIVATE-METHOD (private removed). With --format json, every problem lists its fixes as exact edits (file, a range with 1-based line and column, and newText).

j2c report assesses a migration before you start it:

java -jar target/j2c-cli.jar report . > migration-report.md      # Markdown

java -jar target/j2c-cli.jar report --format json src/main/java # JSON

It takes the same inputs and options as --check (and --runtime) and shows the files, types and methods that translate as they are (no problem from --check lies within them), the blockers by problem ID and by package with their top locations and how many j2c fix can fix, test-feature blockers with --tests, the JDK types and members the code uses compared with what the J2C runtime provides (the rest would be stubs that fail at run time), and next steps.

--line-directives adds #line directives to the generated C++, so compiler errors and debuggers (gdb: break Foo.java:21, list) refer to Java files and lines. Each C++ line maps to the Java statement it came from, also in lambdas; generated boilerplate keeps its C++ file and line. Paths in the directives are relative to the output directory, where make runs. Without the option the generated files are unchanged.

j2c build compiles translated code and reports the compiler's errors at their Java lines:

java -jar target/j2c-cli.jar build --output build/cpp src/main/java  # translate with directives, then make

java -jar target/j2c-cli.jar build --output build/cpp --format json # build earlier J2C output

It runs make -k in the output directory (in WSL on Windows when make is not on the PATH; --wsl auto|always|never, --wsl-distro , --make , --target , --jobs , or the variables J2C_MAKE, J2C_WSL and J2C_WSL_DISTRO), parses GCC and Clang diagnostics, and prints each at its Java file and line with its C++ location. A diagnostic in generated code outside any Java statement is reported in C++ with the nearest Java line before it. With --format json the result has status, exitCode, diagnostics (severity, message, java, cpp, mapped, notes, includedFrom), summary and the end of the log.

The CLI exits with status 0 on success (or a clean check), 1 when translation fails or a check finds problems, and 2 for invalid arguments. j2c build exits with 0 when

只显示了开头部分;其余内容请在仓库中阅读

问 PopNx