search
HomeOperation and MaintenanceMac OSHow to configure java environment variables under macos system

How to configure java environment variables under macos system

Nov 26, 2020 pm 03:27 PM
javamacosenvironment variables

How to configure java environment variables under macos system

The specific configuration steps are as follows:

1. Edit bash_profile

vim ~/.bash_profile
输入以下内容并保存

export JAVA_HOME=`/usr/libexec/java_home`
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME 
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin

2. Make the environment variables effective

source ~/.bash_profile

3. Verify

tianshl@tianshl ~ $ echo $PATH

4. Note

Before using fish, you must exit fish

/usr/libexec/java_home This command can output the path of JAVA_HOME

Related recommendations: macos

The above is the detailed content of How to configure java environment variables under macos system. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete
The Current macOS: An Overview of Apple's Latest OSThe Current macOS: An Overview of Apple's Latest OSMay 04, 2025 am 12:18 AM

macOSSonoma (14.0) brings new features such as desktop widgets, video conferencing enhancements and performance improvements. 1. The desktop widget allows users to quickly view information. 2. Video conferencing enhancement provides virtual background function. 3. System performance is improved, and application startup and response are faster.

Is macOS Based on Linux? Debunking the MythsIs macOS Based on Linux? Debunking the MythsMay 03, 2025 am 12:02 AM

No,macOSisnotbasedonLinux;itisbuiltonDarwin,aUnix-basedsystemdevelopedbyApple.1)macOSusesDarwin,whichincorporatesBSDelements,whileLinuxusestheLinuxkernel.2)macOSintegrateswithApple'shardwareforoptimizedperformance,unlikeLinux.3)macOSusesHomebrewforpa

macOS Automation: Mastering Automator & AppleScript for EfficiencymacOS Automation: Mastering Automator & AppleScript for EfficiencyMay 02, 2025 am 12:02 AM

Automator and AppleScript are automation tools that come with macOS, which can simplify daily tasks through graphical programming and scripting languages. 1. Automator creates workflows through drag and drop actions, suitable for codeless users. 2. AppleScript provides higher flexibility and customization capabilities, suitable for complex tasks.

macOS: Exploring the BSD Foundation and its ImpactmacOS: Exploring the BSD Foundation and its ImpactMay 01, 2025 am 12:11 AM

macOS is based on BSD and affects its kernel, command line tools, networking, security and developer tools. 1. The XNU kernel of macOS contains the BSD subsystem. 2. Command line tools such as ls, CP, and mv are derived from BSD. 3. Network protocol stack and firewall technology come from BSD. 4. Developer tools such as gcc and make are based on BSD, enhancing the development environment of macOS.

macOS and Linux: Compatibility and User ExperiencemacOS and Linux: Compatibility and User ExperienceApr 30, 2025 am 12:05 AM

macOS and Linux have their own advantages in compatibility and user experience. macOS has excellent compatibility within the Apple ecosystem, and the user experience is simple and intuitive; Linux has outstanding hardware compatibility and software flexibility. The user experience varies from distribution to distribution, emphasizing personalization and control.

macOS: Key Features for Mac UsersmacOS: Key Features for Mac UsersApr 29, 2025 am 12:30 AM

Key features of macOS include Continuity, APFS, Siri, powerful security, multitasking, and performance optimization. 1.Continuity allows seamless switching of tasks between Mac and other Apple devices. 2. APFS improves file access speed and data protection. 3.Siri can perform tasks and find information. 4. Security functions such as FileVault and Gatekeeper to protect data. 5. MissionControl and Spaces improve multitasking efficiency. 6. Performance optimization includes cleaning caches, optimizing startup items and keeping updates.

macOS: System Architecture and Core ComponentsmacOS: System Architecture and Core ComponentsApr 28, 2025 am 12:05 AM

The system architecture of macOS includes hardware abstraction layer, XNU core, I/OKit, core services and Aqua user interface. Core components include the startup process, the APFS file system, and SystemIntegrityProtection. Performance optimization and best practices involve hardware configuration, software setup, and development skills.

The Current macOS: Everything You Need to KnowThe Current macOS: Everything You Need to KnowApr 27, 2025 am 12:16 AM

macOSSonoma is the latest version launched in 2023. 1) Enhanced video conferencing functions, support virtual backgrounds and reaction effects; 2) Improved game performance, support Metal3 graphics API; 3) Added new privacy and security features, such as lock mode and stronger password protection.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft