tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Java

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-01-06 16:15:34
Java Development Kit (JDK) is the SDK for Java. This document takes JDK 1.7 and 1.8 as examples to describe how to install and configure JDK under Windows and Linux systems.

Windows

1. Downloading a JDK

Go to the Oracle website to download the desired JDK version.

2. Installation

Install the JDK as instructed. You can specify the installation paths (C drive by default), for example, as D:\\Program Files\\Java\\jdk1.8.0_31 and D:\\Program Files\\Java\\jre1.8.0_31.

3. Configuration

After the installation is completed, right-click Computer, and then click Properties > Advanced system settings > Environment Variables > System variables > New to configure the software. Variable name (N): JAVA_HOMEVariable value (V): D:\\Program Files\\Java\\jdk1.8.0_31 (Configure according to your actual installation path).
Variable name (N): CLASSPATHVariable value (V): .;%JAVA_HOME%\\lib\\dt.jar;%JAVA_HOME%\\lib\\tools.jar; (Note that the variable value begins with .). Variable name (N): Path Variable value (V): %JAVA_HOME%\\bin;%JAVA_HOME%\\jre\\bin;

4. Testing

Test whether the configuration is successful: click Start (or shortcut: Win+R) > Run (enter cmd) > OK (or press Enter), then enter the command javac and press Enter. If messages such as command parameters and syntax are displayed, the environment variables are configured successfully.

Linux

If openjdk is installed by using yum or apt-get command, the class library may be incomplete, thus leading to errors when you run relevant tools after the installation. Therefore, we recommend that you manually decompress and install JDK. Specific steps are as follows:

1. Download a JDK

Go to the Oracle website to download the desired JDK version to install.
Note:
The following uses jdk-8u151-linux-x64.tar.gz as an example. If you are using other versions, ensure that the extension is .tar.gz.

2. Create a directory

Run the following command to create the java directory in /usr/:
mkdir /usr/java
cd /usr/java
Copy the downloaded jdk-8u151-linux-x64.tar.gz to the /usr/java/ directory.

3. Decompress the JDK

Run the following command to decompress the JDK:
tar -zxvf jdk-8u151-linux-x64.tar.gz

4. Set environment variables

Edit the /etc/profile file. Add the following content to the profile file and save it:
# set java environment
JAVA_HOME=/usr/java/jdk1.8.0_151
JRE_HOME=/usr/java/jdk1.8.0_151/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
Note:
JAVA_HOME and JRE_HOME should be configured according to the actual installation paths and JDK version.
Run the following command for the modifications to take effect:
source /etc/profile

5. Test

Run the following command to test the JDK installation:
java -version
If information about the Java version is displayed, the JDK is installed successfully.
java version "1.8.0_151"
Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan