diff --git a/README.md b/README.md
index dbfcd1c0ee4..960ca034d5f 100644
--- a/README.md
+++ b/README.md
@@ -1,45 +1,25 @@
-
- java-tron
-
-
- Java implementation of the Tron Protocol
+ Java implementation of the TRON Protocol
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
## Table of Contents
- [What’s TRON?](#whats-tron)
- [Building the Source Code](#building-the-source-code)
+- [Executables](#executables)
- [Running java-tron](#running-java-tron)
- [Community](#community)
- [Contribution](#contribution)
@@ -49,192 +29,174 @@
# What's TRON?
-TRON is a project dedicated to building the infrastructure for a truly decentralized Internet.
-
-- Tron Protocol, one of the largest blockchain-based operating systems in the world, offers scalable, high-availability and high-throughput support that underlies all the decentralized applications in the TRON ecosystem.
-
-- Tron Virtual Machine (TVM) allows anyone to develop decentralized applications (DAPPs) for themselves or their communities with smart contracts thereby making decentralized crowdfunding and token issuance easier than ever.
+TRON is building the foundational infrastructure for the decentralized internet ecosystem with a focus on high-performance, scalability, and security.
-TRON enables large-scale development and engagement. With over 2000 transactions per second (TPS), high concurrency, low latency, and massive data transmission. It is ideal for building decentralized entertainment applications. Free features and incentive systems allow developers to create premium app experiences for users.
+- TRON Protocol: High-throughput(2000+ TPS), scalable blockchain OS (DPoS consensus) powering the TRON ecosystem.
+- TRON Virtual Machine (TVM): EVM-compatible smart-contract engine for fast smart-contract execution.
# Building the Source Code
+Before building java-tron, make sure you have:
+- Hardware with at least 4 CPU cores, 16 GB RAM, 10 GB free disk space for a smooth compilation process.
+- Operating system: `Linux` or `macOS` (`Windows` is not supported).
+- Git and correct JDK(version `8` or `17`) installed based on your CPU architecture.
-Building java-tron requires `git` package
+There are two ways to install the required dependencies:
-## Operating systems
-Make sure you operate on `Linux` or `MacOS` operating systems, other operating systems are not supported yet.
+- **Option 1: Automated script (recommended for quick setup)**
-## Architecture
+ Use the provided [`install_dependencies.sh`](install_dependencies.sh) script:
-### x86_64
-64-bit version of `Oracle JDK 8` to be installed, other JDK versions are not supported yet.
+ ```bash
+ chmod +x install_dependencies.sh
+ ./install_dependencies.sh
+ ```
+ > **Note**: For production-grade stability with JDK 8 on x86_64 architecture, Oracle JDK 8 is strongly recommended (the script installs OpenJDK 8).
-### ARM64
-64-bit version of `JDK 17` to be installed, other JDK versions are not supported yet.
+- **Option 2: Manual installation**
-## Build
-Clone the repo and switch to the `master` branch
+ Follow the [Prerequisites and Installation Guide](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#prerequisites-before-compiling-java-tron) for step-by-step instructions.
+Once all dependencies have been installed, download and compile java-tron by executing:
```bash
-$ git clone https://github.com/tronprotocol/java-tron.git
-$ cd java-tron
-$ git checkout -t origin/master
+git clone https://github.com/tronprotocol/java-tron.git
+cd java-tron
+git checkout -t origin/master
+./gradlew clean build -x test
```
+* The parameter `-x test` indicates skipping the execution of test cases.
+* If you encounter any error please refer to the [Compiling java-tron Source Code](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#compiling-java-tron-source-code) documentation for troubleshooting steps. Or you could use the pre-built jar file from
-then run the following command to build java-tron, the `FullNode.jar` file can be found in `java-tron/build/libs/` after build successfully.
+# Executables
-```bash
-$ ./gradlew clean build -x test
- # To fix DependencyVerificationException: Dependency verification failed for configuration ':xxx' x artifacts failed verification
-$ ./gradlew clean --refresh-dependencies --write-verification-metadata sha256
+The java-tron project comes with several runnable artifacts and helper scripts found in the project root and build directories.
-```
+| Artifact/Script | Description |
+| :---------------------- | :---------- |
+| **`FullNode.jar`** | Main TRON node executable (generated in `build/libs/` after a successful build following the above guidance). Runs as a full node by default. `java -jar FullNode.jar --help` for command line options|
+| **`Toolkit.jar`** | Node management utility (generated in `build/libs/`): partition, prune, copy, convert DBs; shadow-fork tool. [Usage](https://tronprotocol.github.io/documentation-en/using_javatron/toolkit/#toolkit-a-java-tron-node-maintenance-suite) |
+| **`start.sh`** | Quick start script (x86_64, JDK 8) to download/build/run `FullNode.jar`. See the tool [guide](./shell.md). |
+| **`start.sh.simple`** | Quick start script template (ARM64, JDK 17). See usage notes inside the script. |
# Running java-tron
-## Operating systems
-Make sure you operate on `Linux` or `MacOS` operating systems, other operating systems are not supported yet.
+## Hardware Requirements for Mainnet
-## Architecture
+| Deployment Tier | CPU Cores | Memory | High-performance SSD Storage | Network Downstream |
+|--------------------------|-------|--------|---------------------------|-----------------|
+| FullNode (Minimum) | 8 | 16 GB | 200 GB ([Lite](https://tronprotocol.github.io/documentation-en/using_javatron/litefullnode/#lite-fullnode)) | ≥ 5 MBit/sec |
+| FullNode (Stable) | 8 | 32 GB | 200 GB (Lite) 3.5 TB (Full) | ≥ 5 MBit/sec |
+| FullNode (Recommended) | 16+ | 32 GB+ | 4 TB | ≥ 50 MBit/sec |
+| Super Representative | 32+ | 64 GB+ | 4 TB | ≥ 50 MBit/sec |
-### X86_64
-Requires 64-bit version of `Oracle JDK 8` to be installed, other JDK versions are not supported yet.
+Note: For test networks, where transaction volume is significantly lower, you may operate with reduced hardware specifications.
-### ARM64
-Requires 64-bit version of `JDK 17` to be installed, other JDK versions are not supported yet.
+## Launching a full node
+A full node acts as a gateway to the TRON network, exposing comprehensive interfaces via HTTP and RPC APIs. Through these endpoints, clients may execute asset transfers, deploy smart contracts, and invoke on-chain logic. It must join a TRON network to participate in the network's consensus and transaction processing.
-## Configuration flile
-Get the mainnet configuration file: [config.conf](framework/src/main/resources/config.conf), other network configuration files can be found [here](https://github.com/tronprotocol/tron-deployment).
+### Network Types
-## Hardware Requirements
+The TRON network is mainly divided into:
-| Deployment Tier | CPU Cores | Memory | High-performance SSD Storage | Network Downstream |
-|-----------------|-----------|--------|----------------------------------|--------------------|
-| FullNode (Minimum) | 8 | 16 GB | 200 GB ([Lite](https://tronprotocol.github.io/documentation-en/using_javatron/litefullnode/#lite-fullnode)) | ≥ 5 MB/s |
-| FullNode (Stable) | 8 | 32 GB | 200 GB ([Lite](https://tronprotocol.github.io/documentation-en/using_javatron/litefullnode/#lite-fullnode))
3.5 TB (Full Sync) | ≥ 5 MB/s |
-| FullNode (Recommended) | 16+ | 32 GB+ | 4 TB | ≥ 50 MB/s |
-| Super Representative | 32+ | 64 GB+ | 4 TB | ≥ 50 MB/s |
+- **Main Network (Mainnet)**
+ The primary public blockchain where real value (TRX, TRC-20 tokens, etc.) is transacted, secured by a massive decentralized network.
-## Running a full node for mainnet
+- **[Nile Test Network (Testnet)](https://nileex.io/)**
+ A forward-looking testnet where new features and governance proposals are launched first for developers to experience. Consequently, its codebase is typically ahead of the Mainnet.
-Full node has full historical data, it is the entry point into the TRON network, it can be used by other processes as a gateway into the TRON network via HTTP and GRPC endpoints. You can interact with the TRON network through full node:transfer assets, deploy contracts, interact with contracts and so on. `-c` parameter specifies a configuration file to run a full node:
+- **[Shasta Testnet](https://shasta.tronex.io/)**
+ Closely mirrors the Mainnet’s features and governance proposals. Its network parameters and software versions are kept in sync with the Mainnet, providing developers with a highly realistic environment for final testing.
-### x86_64 (JDK 8)
-```bash
-$ nohup java -Xms9G -Xmx12G -XX:ReservedCodeCacheSize=256m \
- -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m \
- -XX:MaxDirectMemorySize=1G -XX:+PrintGCDetails \
- -XX:+PrintGCDateStamps -Xloggc:gc.log \
- -XX:+UseConcMarkSweepGC -XX:NewRatio=3 \
- -XX:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled \
- -XX:+HeapDumpOnOutOfMemoryError \
- -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 \
- -jar FullNode.jar -c main_net_config.conf >> start.log 2>&1 &
-```
-### ARM64 (JDK 17)
+- **Private Networks**
+ Customized TRON networks set up by private entities for testing, development, or specific use cases.
+
+Network selection is performed by specifying the appropriate configuration file upon full-node startup. Mainnet configuration: [config.conf](framework/src/main/resources/config.conf); Nile testnet configuration: [config-nile.conf](https://github.com/tron-nile-testnet/nile-testnet/blob/master/framework/src/main/resources/config-nile.conf)
+
+### 1. Join the TRON main network
+Launch a main-network full node with the built-in default configuration:
```bash
-$ nohup java -Xmx9G -XX:+UseZGC \
- -Xlog:gc,gc+heap:file=gc.log:time,tags,level:filecount=10,filesize=100M \
- -XX:ReservedCodeCacheSize=256m \
- -XX:+UseCodeCacheFlushing \
- -XX:MetaspaceSize=256m \
- -XX:MaxMetaspaceSize=512m \
- -XX:MaxDirectMemorySize=1g \
- -XX:+HeapDumpOnOutOfMemoryError \
- -jar FullNode.jar -c main_net_config.conf >> start.log 2>&1 &
+nohup java -Xms9G -jar ./build/libs/FullNode.jar &
```
+* `nohup ... &`: Runs the command in the background and ignores the hangup signal.
+* `-Xms9G`: Sets the JVM minimum heap size to `9 GB`.
-> **Memory Tuning**
-> - For 16 GB RAM servers: JDK 8 use `-Xms9G -Xmx12G`; JDK 17 use `-Xmx9G`.
-> - For servers with ≥32 GB RAM, suggest setting the maximum heap size (`-Xmx`) to 40 % of total RAM.
+> For the main network production deployments, review the [JVM Parameter Optimization for FullNode](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#jvm-parameter-optimization-for-mainnet-fullnode-deployment) to use the complete Java command.
-## Running a super representative node for mainnet
+Using the below command, you can monitor the blocks syncing progress:
+```bash
+tail -f ./logs/tron.log
+```
-Adding the `--witness` parameter to the startup command, full node will run as a super representative node. The super representative node supports all the functions of the full node and also supports block production. Before running, make sure you have a super representative account and get votes from others. Once the number of obtained votes ranks in the top 27, your super representative node will participate in block production.
+Use [TronScan](https://tronscan.org/#/), TRON's official block explorer, to view main network transactions, blocks, accounts, witness voting, and governance metrics, etc.
-Fill in the private key of a super representative address into the `localwitness` list in the `main_net_config.conf`. Here is an example:
+### 2. Join Nile test network
+Utilize the `-c` flag to direct the node to the configuration file corresponding to the desired network. Since Nile TestNet may incorporate features not yet available on the MainNet, it is **strongly advised** to compile the source code following the [Building the Source Code](https://github.com/tron-nile-testnet/nile-testnet/blob/master/README.md#building-the-source-code) instructions for the Nile TestNet.
-```
- localwitness = [
-
- ]
+```bash
+nohup java -jar ./build/libs/FullNode.jar -c config-nile.conf &
```
-then run the following command to start the node:
+Nile resources: explorer, faucet, wallet, developer docs, and network statistics at [nileex.io](https://nileex.io/).
-### x86_64 (JDK 8)
-```bash
-$ nohup java -Xms9G -Xmx12G -XX:ReservedCodeCacheSize=256m \
- -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=512m \
- -XX:MaxDirectMemorySize=1G -XX:+PrintGCDetails \
- -XX:+PrintGCDateStamps -Xloggc:gc.log \
- -XX:+UseConcMarkSweepGC -XX:NewRatio=3 \
- -XX:+CMSScavengeBeforeRemark -XX:+ParallelRefProcEnabled \
- -XX:+HeapDumpOnOutOfMemoryError \
- -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 \
- -jar FullNode.jar --witness -c main_net_config.conf >> start.log 2>&1 &
-```
-### ARM64 (JDK 17)
-```bash
-$ nohup java -Xms9G -Xmx9G -XX:+UseZGC \
- -Xlog:gc,gc+heap:file=gc.log:time,tags,level:filecount=10,filesize=100M \
- -XX:ReservedCodeCacheSize=256m \
- -XX:+UseCodeCacheFlushing \
- -XX:MetaspaceSize=256m \
- -XX:MaxMetaspaceSize=512m \
- -XX:MaxDirectMemorySize=1g \
- -XX:+HeapDumpOnOutOfMemoryError \
- -jar FullNode.jar --witness -c main_net_config.conf >> start.log 2>&1 &
-```
+### 3. Access Shasta test network
+Shasta does not accept public node peers. Programmatic access is available via TronGrid endpoints; see [TronGrid Service](https://developers.tron.network/docs/trongrid) for details.
-## Quick Start Tool
+Shasta resources: explorer, faucet, wallet, developer docs, and network statistics at [shastaex.io](https://shasta.tronex.io/).
-### x86_64 (JDK 8)
-An easier way to build and run java-tron is to use `start.sh`. `start.sh` is a quick start script written in the Shell language. You can use it to build and run java-tron quickly and easily.
+### 4. Set up a private network
+To set up a private network for testing or development, follow the [Private Network guidance](https://tronprotocol.github.io/documentation-en/using_javatron/private_network/).
-Here are some common use cases of the scripting tool
-- Use `start.sh` to start a full node with the downloaded `FullNode.jar`
-- Use `start.sh` to download the latest `FullNode.jar` and start a full node.
-- Use `start.sh` to download the latest source code and compile a `FullNode.jar` and then start a full node.
+## Running a super representative node
-For more details, please refer to the tool [guide](./shell.md).
+To operate the node as a Super Representative (SR), append the `--witness` parameter to the standard launch command. An SR node inherits every capability of a FullNode and additionally participates in block production. Refer to the [Super Representative documentation](https://tronprotocol.github.io/documentation-en/mechanism-algorithm/sr/) for eligibility requirements.
-### ARM64 (JDK 17)
-You can refer to the [start.sh.simple](start.sh.simple).
+Fill in the private key of your SR account into the `localwitness` list in the configuration file. Here is an example:
-```bash
-# cp start.sh.simple start.sh
-# Usage:
-# sh start.sh # Start the java-tron FullNode
-# sh start.sh -s # Stop the java-tron FullNode
-# sh start.sh [options] # Start with additional java-tron options,such as: -c config.conf -d /path_to_data, etc.
-#
+```
+ localwitness = [
+
+ ]
```
-## Run inside Docker container
+Subsequently, launch the node by executing the optimized Java startup command detailed in the [JVM Parameter Optimization for Mainnet FullNode Deployment](https://tronprotocol.github.io/documentation-en/using_javatron/installing_javatron/#jvm-parameter-optimization-for-mainnet-fullnode-deployment) guidance. You could also test the process by connecting to a testnet or setting up a private network.
-One of the quickest ways to get `java-tron` up and running on your machine is by using Docker:
+## Programmatically interfacing FullNode
+
+Upon the FullNode startup successfully, interaction with the TRON network is facilitated through a comprehensive suite of programmatic interfaces exposed by java-tron:
+- **HTTP API**: See the complete [HTTP API reference and endpoint list](https://tronprotocol.github.io/documentation-en/api/http/).
+- **gRPC**: High-performance APIs suitable for service-to-service integration. See the supported [gRPC reference](https://tronprotocol.github.io/documentation-en/api/rpc/).
+- **JSON-RPC**: Provides Ethereum-compatible JSON-RPC methods for logs, transactions and contract calls. See the supported [JSON-RPC methods](https://tronprotocol.github.io/documentation-en/api/json-rpc/).
+
+Enable or disable each interface in the configuration file:
-```shell
-$ docker run -d --name="java-tron" \
- -v /your_path/output-directory:/java-tron/output-directory \
- -v /your_path/logs:/java-tron/logs \
- -p 8090:8090 -p 18888:18888 -p 50051:50051 \
- tronprotocol/java-tron \
- -c /java-tron/config/main_net_config.conf
```
+node {
+ http {
+ fullNodeEnable = true
+ fullNodePort = 8090
+ }
+
+ jsonrpc {
+ httpFullNodeEnable = true
+ httpFullNodePort = 8545
+ }
+
+ rpc {
+ enable = true
+ port = 9090
+ }
+}
+```
+When exposing any of these APIs to a public interface, ensure the node is protected with appropriate authentication, rate limiting, and network access controls in line with your security requirements.
-This will mount the `output-directory` and `logs` directories on the host, the docker.sh tool can also be used to simplify the use of docker, see more [here](docker/docker.md).
+Public hosted HTTP endpoints for both mainnet and testnet are provided by TronGrid. Please refer to the [TRON Network HTTP Endpoints](https://developers.tron.network/docs/connect-to-the-tron-network#tron-network-http-endpoints) for the latest list. For supported methods and request formats, see the HTTP API reference above.
# Community
-[Tron Developers & SRs](https://discord.gg/hqKvyAM) is Tron's official Discord channel. Feel free to join this channel if you have any questions.
-
-The [Core Devs Community](https://t.me/troncoredevscommunity) and [Tron Official Developer Group](https://t.me/TronOfficialDevelopersGroupEn) are Telegram channels specifically designed for java-tron community developers to engage in technical discussions.
+[TRON Developers & SRs](https://discord.gg/hqKvyAM) is TRON's official Discord channel. Feel free to join this channel if you have any questions.
-[tronprotocol/allcoredev](https://gitter.im/tronprotocol/allcoredev) is the official Gitter channel for developers.
+The [Core Devs Community](https://t.me/troncoredevscommunity) and [TRON Official Developer Group](https://t.me/TronOfficialDevelopersGroupEn) are Telegram channels specifically designed for java-tron community developers to engage in technical discussions.
# Contribution
@@ -244,8 +206,9 @@ Thank you for considering to help out with the source code! If you'd like to con
- [Medium](https://medium.com/@coredevs) java-tron's official technical articles are published there.
- [Documentation](https://tronprotocol.github.io/documentation-en/) and [TRON Developer Hub](https://developers.tron.network/) serve as java-tron’s primary documentation websites.
-- [Test network](http://nileex.io/) A stable test network of TRON contributed by TRON community.
-- [Tronscan](https://tronscan.org/#/) TRON network blockchain browser.
+- [TronScan](https://tronscan.org/#/) TRON main network blockchain browser.
+- [Nile Test network](http://nileex.io/) A stable test network of TRON contributed by TRON community.
+- [Shasta Test network](https://shasta.tronex.io/) A stable test network of TRON contributed by TRON community.
- [Wallet-cli](https://github.com/tronprotocol/wallet-cli) TRON network wallet using command line.
- [TIP](https://github.com/tronprotocol/tips) TRON Improvement Proposal (TIP) describes standards for the TRON network.
- [TP](https://github.com/tronprotocol/tips/tree/master/tp) TRON Protocol (TP) describes standards already implemented in TRON network but not published as a TIP.
diff --git a/install_dependencies.sh b/install_dependencies.sh
new file mode 100755
index 00000000000..860e79440eb
--- /dev/null
+++ b/install_dependencies.sh
@@ -0,0 +1,131 @@
+#!/usr/bin/env bash
+
+set -e
+
+OS="$(uname -s)"
+ARCH="$(uname -m)"
+
+echo ">>> Environment Detection"
+if [[ "$OS" == "Darwin" ]]; then
+ echo " OS: MacOS $OS"
+elif [[ "$OS" == "Linux" ]]; then
+ echo " OS: $OS"
+fi
+echo " Architecture: $ARCH"
+echo "----------------------------------------"
+echo ">>> Note: This script has been tested on:"
+echo " - macOS x86_64 (JDK 8)"
+echo " - macOS arm64 (JDK 17)"
+echo " - Linux x86_64 (generic, including Ubuntu) (JDK 8)"
+echo " - Linux arm64/aarch64 (generic, including Ubuntu) (JDK 17)"
+echo "----------------------------------------"
+
+install_macos() {
+ if ! command -v brew &> /dev/null; then
+ echo ">>> Homebrew not found. Installing Homebrew..."
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
+
+ # Add Homebrew to PATH for the current session (Apple Silicon vs Intel)
+ if [[ "$ARCH" == "arm64" ]]; then
+ eval "$(/opt/homebrew/bin/brew shellenv)"
+ else
+ eval "$(/usr/local/bin/brew shellenv)"
+ fi
+ fi
+
+ echo ">>> Updating Homebrew..."
+ brew update
+
+ echo ">>> Installing Git..."
+ brew install git
+
+ if [[ "$ARCH" == "x86_64" ]]; then
+ echo ">>> Architecture is x86_64. Installing JDK 8..."
+ brew install openjdk@8
+
+ echo ">>> Configuring PATH for openjdk@8 in this script session..."
+ export PATH="/usr/local/opt/openjdk@8/bin:$PATH"
+ echo " PATH updated to include /usr/local/opt/openjdk@8/bin"
+
+ elif [[ "$ARCH" == "arm64" ]]; then
+ echo ">>> Architecture is arm64. Installing JDK 17..."
+ brew install openjdk@17
+
+ echo ">>> Configuring PATH for openjdk@17 in this script session..."
+ export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
+ echo " PATH updated to include /opt/homebrew/opt/openjdk@17/bin"
+
+ else
+ echo "Error: Unsupported architecture for macOS script: $ARCH"
+ exit 1
+ fi
+}
+
+install_linux() {
+ if command -v dnf &> /dev/null; then
+ PKG_MANAGER="dnf"
+ INSTALL_CMD="sudo dnf install -y"
+ UPDATE_CMD="sudo dnf check-update"
+ elif command -v yum &> /dev/null; then
+ PKG_MANAGER="yum"
+ INSTALL_CMD="sudo yum install -y"
+ UPDATE_CMD="sudo yum check-update"
+ elif command -v apt-get &> /dev/null; then
+ PKG_MANAGER="apt-get"
+ INSTALL_CMD="sudo apt-get install -y"
+ UPDATE_CMD="sudo apt-get update"
+ else
+ echo "Error: Unsupported package manager. Only apt-get (Debian/Ubuntu) and yum/dnf (RHEL/CentOS/Amazon Linux) are currently supported."
+ exit 1
+ fi
+
+ echo ">>> Updating package index ($PKG_MANAGER)..."
+ $UPDATE_CMD || true
+
+ echo ">>> Installing Git..."
+ $INSTALL_CMD git
+
+ install_first_available() {
+ for pkg in "$@"; do
+ if $INSTALL_CMD "$pkg"; then
+ return 0
+ fi
+ done
+ return 1
+ }
+
+ if [[ "$ARCH" == "x86_64" ]]; then
+ echo ">>> Architecture is x86_64. Installing JDK 8..."
+ if [[ "$PKG_MANAGER" == "apt-get" ]]; then
+ install_first_available openjdk-8-jdk
+ else
+ install_first_available java-1.8.0-amazon-corretto-devel java-1.8.0-openjdk-devel
+ fi || { echo "Error: Unable to install JDK 8 on $PKG_MANAGER"; exit 1; }
+ elif [[ "$ARCH" == "aarch64" ]] || [[ "$ARCH" == "arm64" ]]; then
+ echo ">>> Architecture is arm64/aarch64. Installing JDK 17..."
+ if [[ "$PKG_MANAGER" == "apt-get" ]]; then
+ install_first_available openjdk-17-jdk
+ else
+ install_first_available java-17-amazon-corretto-devel java-17-openjdk-devel
+ fi || { echo "Error: Unable to install JDK 17 on $PKG_MANAGER"; exit 1; }
+ else
+ echo "Error: Unsupported architecture for Linux script: $ARCH"
+ exit 1
+ fi
+}
+
+if [[ "$OS" == "Darwin" ]]; then
+ install_macos
+elif [[ "$OS" == "Linux" ]]; then
+ install_linux
+else
+ echo "Error: Unsupported Operating System: $OS"
+ exit 1
+fi
+
+echo "----------------------------------------"
+echo ">>> Installation logic completed."
+echo "Please verify installations manually if any errors occurred above."
+echo "Check versions with:"
+echo " git --version"
+echo " java -version"