0% found this document useful (0 votes)
3 views

Update JDK via CMD

The document provides instructions for updating the JDK on Windows, Mac, and Linux systems via the command line. It includes steps for checking the current version, downloading and installing the latest JDK, updating environment variables, and verifying the installation. Additionally, it addresses common errors related to running JADE applications and offers troubleshooting steps.

Uploaded by

Walid Chaib
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Update JDK via CMD

The document provides instructions for updating the JDK on Windows, Mac, and Linux systems via the command line. It includes steps for checking the current version, downloading and installing the latest JDK, updating environment variables, and verifying the installation. Additionally, it addresses common errors related to running JADE applications and offers troubleshooting steps.

Uploaded by

Walid Chaib
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Update JDK via CMD

update jdk with cmd

Updating the JDK via the command line depends on your operating system. Here’s how you
can do it:

Windows (Using Command Prompt & PowerShell)

1. Check Your Current JDK Version

Open Command Prompt and run:

sh

java -version

and

sh

javac -version

2. Download and Install the Latest JDK

1. Visit the Oracle JDK or OpenJDK page.

2. Download the latest JDK installer and install it.

3. Note the installation path (e.g., C:\Program Files\Java\jdk-XX.X.X ).

3. Update the Environment Variables

Run these commands in Command Prompt or PowerShell (Admin) to update the Java path:

sh

setx JAVA_HOME "C:\Program Files\Java\jdk-XX.X.X"


setx PATH "%JAVA_HOME%\bin;%PATH%"

After that, restart your terminal and verify with:

sh

java -version

1/5
javac -version

Mac (Using Terminal)

1. Check Current Version

sh

java -version

2. Install JDK with Homebrew (Recommended)

sh

brew install openjdk

To update an existing installation:

sh

brew upgrade openjdk

3. Set Java Path

sh

export JAVA_HOME=$(/usr/libexec/java_home)

To make this permanent, add it to your ~/.zshrc or ~/.bashrc :

sh

echo 'export JAVA_HOME=$(/usr/libexec/java_home)' >> ~/.zshrc


source ~/.zshrc

Linux (Ubuntu/Debian)

2/5
1. Check Current Version

sh

java -version

2. Install or Update OpenJDK

sh

sudo apt update


sudo apt install openjdk-XX-jdk

To set the default JDK:

sh

sudo update-alternatives --config java

Select the correct version and verify:

sh

java -version
javac -version

Would you like specific steps for a different setup? 🚀


C:\Users\LaptopSpace>java -cp jade.jar;jadeTools.jar
jade.Boot -gui
Error: Could not find or load main class jade.Boot

The error "Could not find or load main class jade.Boot" typically occurs due to one of the
following reasons:

1. Incorrect Classpath (JADE JAR files not found)

2. Incorrect File Paths (JADE JARs not in the specified directory)

3. Java Version Compatibility Issues

Solution Steps

✅ 1. Verify JADE JAR Files Exist

3/5
Make sure jade.jar and jadeTools.jar are present in the current directory
( C:\Users\LaptopSpace ). Run:

sh

dir jade*.jar

If the files are missing, download JADE from JADE Official Site and place them in the correct
directory.

✅ 2. Use Full Paths for JAR Files


Try specifying the full paths to jade.jar and jadeTools.jar . Example:

sh

java -cp "C:\Users\LaptopSpace\jade.jar;C:\Users\LaptopSpace\jadeTools.jar"


jade.Boot -gui

✅ 3. Check If the JAR Contains jade.Boot

Run this command to list the contents of jade.jar :

sh

jar tf jade.jar | findstr "jade/Boot.class"

If the class is missing, the JAR might be corrupted or not properly downloaded.

✅ 4. Ensure You Have the Correct Java Version


JADE is usually tested with Java 8 or later. Check your Java version:

sh

java -version

If needed, switch to Java 8 or install a newer JDK.

✅ 5. Try Running With -jar Instead of -cp

If JADE has a manifest file specifying the main class, this might work:

sh

4/5
java -jar jade.jar -gui

Let me know if you still face issues! 🚀

5/5

You might also like