> For the complete documentation index, see [llms.txt](/es/llms.txt).

To setup a Rootstock node using Java, you need to:

- Ensure your system meets the [minimum requirements](/node-operators/setup/requirements/) for installing the Rootstock node.
- Install [Java 17 JDK](https://www.java.com/download/).

:::warning[Important]

Starting with [v6.4.0](/changelog/), the minimum supported Java LTS version is Java 17. Previous Java versions will no longer be supported.

:::

:::tip[For Mac M1 / M2 (Apple Chips) using x86 based software]

- Ensure you have `Rosetta` installed. This is typically pre-installed on recent macOS versions.
- Download an x86 JDK build, such as [Azul Zulu 17 (x86)](https://www.azul.com/downloads/?version=java-17-lts&os=macos&package=jdk#zulu), to ensure compatibility with x86 based software.

:::

## Video walkthrough

Video: <https://www.youtube-nocookie.com/embed/TxpS6WhxUiU?cc_load_policy=1>

## Install the node using a JAR file

### Download and Setup

1. **Download the JAR**: Download the Fat JAR or Uber JAR from [RSKj releases](https://github.com/rsksmart/rskj/releases), or compile it [reproducibly](https://github.com/rsksmart/rskj/wiki/Reproducible-Build).

2. **Create Directory**: Create a directory for the node.

```jsx
mkdir rskj-node-jar
cd ~/rskj-node-jar
```

3. **Move the JAR**: Move or copy the just downloaded jar file to your directory.

```jsx
mv ~/Downloads/rskj-core-7.0.0-LOVELL-all.jar SHA256SUMS.asc /Users/{user}/rskj-node-jar/
```

### Run the Node

**Linux, Mac OSX:**

```shell
java -cp <PATH-TO-THE-RSKJ-JAR> co.rsk.Start
```

**Windows:**

```shell
java -cp <PATH-TO-THE-RSKJ-JAR> co.rsk.Start
```

:::tip[Tip]

Replace `<PATH-TO-THE-RSKJ-JAR>` with the actual path to your JAR file. For example, `C:/RskjCode/rskj-core-7.0.0-LOVELL-all.jar`.
:::

## Using Import Sync

Instead of syncing the whole chain from peers, a **new** node can be bootstrapped from published bootstrap data — a pre-synchronized database, signed by its publishers. RSKj downloads and verifies it for you; there is no file to fetch yourself and no path to pass to the flag.

:::danger[Import sync erases the database every time it runs]

Every time a node starts with import enabled, it **deletes its database directory** and downloads the bootstrap data again — even if the node was fully synced a minute earlier. Run it as a one-off from the command line, and never leave `database.import.enabled = true` in a configuration file.

:::

In short:

1. Check that you are on **Java 17** and RSKj **`VETIVER-9.0.4` or later** — earlier versions cannot read the bootstrap data published today.
2. Make sure you have room for a full node's database, per the [minimum requirements](/node-operators/setup/requirements/), plus about three times the size of the bootstrap archive in temporary space.
3. Run the node **once** with `--import`. RSKj downloads the published bootstrap data, checks that enough trusted signers agree on it, and loads it into a fresh database.
4. Stop the node and start it again **without** `--import`. It continues syncing from the imported height.
5. Remove the leftover archive and extracted file from the temporary directory.

**Linux, Mac OSX:**

```shell
java -Xmx4G -cp <PATH-TO-THE-RSKJ-JAR> co.rsk.Start --import
```

**Windows:**

```shell
C:\> java -Xmx4G -cp <PATH-TO-THE-RSKJ-JAR> co.rsk.Start --import
```

Set `-Xmx4G` on this command. Left out, the JVM sizes the heap from the machine's physical RAM instead, so what the import gets depends on the host rather than on what the import needs — and it runs out only after the download has already finished. If the import still fails with `OutOfMemoryError`, raise it further.

:::tip[Tip]

Replace `<PATH-TO-THE-RSKJ-JAR>` with your JAR file path. For configuration details, see [`database.import` setting](/node-operators/setup/configuration/reference#databaseimport).
:::

For the full procedure — checking which height the import will land you on before committing to the download, confirming it worked, cleaning up, and what each failure message means — see [Bootstrap a node using Import Sync](/node-operators/setup/import-sync/).

## Check the RPC

:::info[Info]

After starting the node, if there's no output, this means it's running correctly.
:::

1. To confirm, open a new console tab (it is important you do not close this tab or interrupt the process) and test the node's RPC server. A sample cURL request:

**Linux, Mac OSX:**

```shell
curl http://localhost:4444 -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}'
```

**Windows:**

```shell
curl http://localhost:4444 -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}'
```

Output:

```shell
{"jsonrpc":"2.0","id":67,"result":"RSKj/6.6.0/Mac OS X/Java17/SNAPSHOT-95a8f1ab84"}
```

2. To check the block number:

**Linux, Mac OSX:**

```shell
curl -X POST http://localhost:4444/ -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_blockNumber","params":[],"id":1}'
```

**Windows:**

```windows-command-prompt
curl -X POST http://localhost:4444/ -H "Content-Type: application/json" --data '{"jsonrpc":"2.0", "method":"eth_blockNumber","params":[],"id":1}'
```

Output:

```jsx
{"jsonrpc":"2.0","id":1,"result":"0x3710"}
```

:::success[Success]
Now, you have successfully setup a Rootstock node using the jar file.
The `result` property represents the latest synced block in hexadecimal.
:::

## Switching networks

To change networks on the RSKj node, use the following commands:

- Mainnet
  ```bash
  java -cp <PATH-TO-THE-RSKJ-FATJAR> co.rsk.Start
  ```
- Testnet
  ```bash
  java -cp <PATH-TO-THE-RSKJ-FATJAR> co.rsk.Start --testnet
  ```
- Regtest
  ```bash
  java -cp <PATH-TO-THE-RSKJ-FATJAR> co.rsk.Start --regtest
  ```

:::tip[Tip]
Replace `<PATH-TO-THE-RSKJ-FATJAR>` with the actual path to your jar file. For example: `C:/RskjCode/rskj-core-7.0.0-LOVELL-all.jar`.
:::
