- PySpark Cookbook
- Denny Lee Tomasz Drabas
- 204字
- 2021-06-18 19:06:28
Updating PATH
Unix-like operating systems (Windows, too) use the concept of a PATH to search for binaries (or executables, in the case of Windows). The PATH is nothing more than a list of folders separated by the colon character ':' that tells the operating system where to look for binaries.
To add something to your PATH (and make it a permanent change), you need to edit either the .bash_profile (macOS) or .bashrc (Linux) files; these are located in the root folder for your user. Thus, to add both Scala and Maven binaries to the PATH, you can do the following (on macOS):
cp ~/.bash_profile ~/.bash_profile_old # make a copy just in case
echo export SCALA_HOME=/opt/scala >> ~/.bash_profile
echo export MAVEN_HOME=/opt/apache-maven >> ~/.bash_profile
echo PATH=$SCALA_HOME/bin:$MAVEN_HOME/bin:$PATH >> ~/.bash_profile
On Linux, the equivalent looks as follows:
cp ~/.bashrc ~/.bashrc_old # make a copy just in case
echo export SCALA_HOME=/opt/scala >> ~/.bashrc
echo export MAVEN_HOME=/opt/apache-maven >> ~/.bashrc
echo PATH=$SCALA_HOME/bin:$MAVEN_HOME/bin:$PATH >> ~/.bashrc
The preceding commands simply append to the end of either of the .bash_profile or .bashrc files using the redirection operator >>.
Once you execute the preceding commands, restart your Terminal, and:
echo $PATH
It should now include paths to both the Scala and Maven binaries.
- 數(shù)據(jù)結(jié)構(gòu)和算法基礎(chǔ)(Java語(yǔ)言實(shí)現(xiàn))
- CentOS 7 Linux Server Cookbook(Second Edition)
- 數(shù)據(jù)結(jié)構(gòu)(Java語(yǔ)言描述)
- Mastering Unity Shaders and Effects
- Visual Basic程序設(shè)計(jì)實(shí)驗(yàn)指導(dǎo)(第4版)
- Python機(jī)器學(xué)習(xí)經(jīng)典實(shí)例
- AppInventor實(shí)踐教程:Android智能應(yīng)用開(kāi)發(fā)前傳
- 組態(tài)軟件技術(shù)與應(yīng)用
- 速學(xué)Python:程序設(shè)計(jì)從入門到進(jìn)階
- Test-Driven Development with Django
- UNIX Linux程序設(shè)計(jì)教程
- Android移動(dòng)開(kāi)發(fā)案例教程:基于Android Studio開(kāi)發(fā)環(huán)境
- Python數(shù)據(jù)可視化之美:專業(yè)圖表繪制指南(全彩)
- 深入理解Java虛擬機(jī):JVM高級(jí)特性與最佳實(shí)踐
- Java EE 程序設(shè)計(jì)