Registry / serialization / j2ts-jre

j2ts-jre

JSON →
library92.0.0jsnpmunverified

Runtime library required for code transpiled by the Java2TypeScript (J2TS) transpiler. Stable version 92.0.0 provides a set of Java-like utilities (e.g., ArrayList, HashMap) for TypeScript/JavaScript environments. Release cadence is tied to the J2TS transpiler. Key differentiator: enables running Java-derived code directly on Node.js or in browsers with minimal overhead. Only use as a dependency for J2TS projects.

npm install j2ts-jre
INSTALL
IMPORT
SIG · J2TS-JRE
J
j2ts-jre
serializationjavascriptv92.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ArrayList
import { ArrayList } from 'j2ts-jre'
const ArrayList = require('j2ts-jre').ArrayList
ESM-only package. No default export.
HashMap
import { HashMap } from 'j2ts-jre'
import HashMap from 'j2ts-jre'
Named export. Default import will fail.
StringBuilder
import { StringBuilder } from 'j2ts-jre'
import { StringBuilder } from 'j2ts-jre/src/index'
Do not deep-import internal paths.
RuntimeExportedClass
import { RuntimeExportedClass } from 'j2ts-jre'
Any class from J2TS is exported from the package root.

Demonstrates creating an ArrayList, adding elements, accessing by index, and iteration.

import { ArrayList } from 'j2ts-jre'; // Create an ArrayList and add elements const list = new ArrayList<string>(); list.add('hello'); list.add('world'); console.log(list.size()); // 2 // Iterate for (let i = 0; i < list.size(); i++) { console.log(list.get(i)); }
Debug
Known issues
gotchaPackage is a runtime dependency for J2TS transpiled code. Do not manually add unless you are using the J2TS transpiler.
fix
Follow J2TS documentation for setup.
affects: >=0.0.0
breakingBreaking changes occur frequently with major version bumps due to transpiler compatibility. See J2TS changelog.
fix
Upgrade both J2TS and j2ts-jre together.
affects: <92.0.0
deprecatedSome Java methods may be deprecated in future versions. Check source for deprecation warnings.
fix
Use alternative methods as indicated in documentation.
affects: >=92.0.0
Errors
Common errors & fixes
Cannot find module 'j2ts-jre'
Package not installed or missing from package.json.
fix
Run 'npm install j2ts-jre'
TypeError: ArrayList is not a constructor
Incorrect import pattern (e.g., default import instead of named import).
fix
Use 'import { ArrayList } from 'j2ts-jre''
Module not found: Error: Can't resolve 'j2ts-jre/src/ArrayList'
Deep importing internal modules instead of using the main export.
fix
Import from the package root: 'import { ArrayList } from 'j2ts-jre''
Upgrade
Version history
92.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
j2ts-jre — npm install j2ts-jre · libregistry