ubuntu-更改镜像源-系统初始化-安装Clion-C++编译环境-Java安装

文章目录

1.镜像配置文件及更新

将sources.list备份保存为sources.list.backup,以防止有需要的时候更换回来。

powershell 复制代码
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo gedit /etc/apt/sources.list

ubuntu1604添加阿里云镜像,添加如下内容:

powershell 复制代码
########   Ubuntu16.04 阿里云镜像源   ###############
deb https://mirrors.aliyun.com/ubuntu/ xenial main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial main
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb https://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial universe
deb https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb https://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security main
deb https://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src https://mirrors.aliyun.com/ubuntu/ xenial-security universe

执行更新命令:

powershell 复制代码
sudo apt-get update # 更新软件列表
sudo apt-get upgrade # 更新本地软件

2.安装java sdk并配置环境变量

将文件夹移动到/usr/local/jdk1.8文件夹。

powershell 复制代码
sudo mv ~/Desktop/jdk1.8.0_391 /usr/local/jdk1.8

编辑全局环境变量文件vim /etc/profile,添加如下内容:

powershell 复制代码
export JAVA_HOME=/usr/local/jdk1.8
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=.:${JAVA_HOME}/bin:$PATH

使环境变量生效:

powershell 复制代码
source /etc/profile 

检测是否安装成功:

powershell 复制代码
java -version

3.安装Clion

从官网下载Clion,然后解压到指定目录~/Software/CLion。然后定位到目录进行启动。如下所示:

powershell 复制代码
ajz@ubuntu:~/Software/CLion/clion-2023.3/bin$ sudo sh clion.sh

跟jetbrain全家桶风格高度类似。

4.总结

熟练使用VS开发C++的同学,可以直接在windows下进行开发,必须使用标准C++,不要使用windows sdk相关的库和接口,然后在ubuntu下进行调试梳理,一般建议直接在ubuntu下开发,这样可以最大限度的减轻相关工作量。

相关推荐
重生之我要进大厂8 分钟前
LeetCode 876
java·开发语言·数据结构·算法·leetcode
_祝你今天愉快11 分钟前
技术成神之路:设计模式(十四)享元模式
java·设计模式
ice___Cpu12 分钟前
Linux 基本使用和 web 程序部署 ( 8000 字 Linux 入门 )
linux·运维·前端
z2023050814 分钟前
linux 之0号进程、1号进程、2号进程
linux·运维·服务器
狐心kitsune1 小时前
erlang学习:Linux常用命令1
linux·学习·erlang
小筱在线1 小时前
SpringCloud微服务实现服务熔断的实践指南
java·spring cloud·微服务
luoluoal1 小时前
java项目之基于Spring Boot智能无人仓库管理源码(springboot+vue)
java·vue.js·spring boot
ChinaRainbowSea1 小时前
十三,Spring Boot 中注入 Servlet,Filter,Listener
java·spring boot·spring·servlet·web
小游鱼KF1 小时前
Spring学习前置知识
java·学习·spring
扎克begod1 小时前
JAVA并发编程系列(9)CyclicBarrier循环屏障原理分析
java·开发语言·python