Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

II. Manual

wizawu edited this page Mar 9, 2023 · 3 revisions

1. Installation

  • Install JDK (from 8 to 14) and gradle (6 or upper). Make sure the following commands is found.

    java javap jjs gradle
    
  • Install npm (6 or upper).

  • Install tyrian from NPM registry.

    npm install -g tyrian

2. Add dependencies

You must specify the exact version for each Maven dependency in package.json. Versions like ^1.2.3, ~1.2.3 and 1.2.x are NOT allowed.

{
  "mvnDependencies": {
    "com.github.ben-manes.caffeine:caffeine": "3.0.1", // Good
    "com.google.code.gson:gson": "^2.7"                // Bad
  }
}

As for NPM dependencies, you can just use the usual fields for them, such as dependencies and peerDependencies.

3. Import Java classes

Here are some examples.

const { Files, Paths } = java.nio.file
const HttpURLConnection = java.net.HttpURLConnection

type Raven = com.getsentry.raven.Raven
const raven: Raven = RavenFactory.ravenInstance("DSN")
Clone this wiki locally