Linux configure for java web developer

安装ubuntu需要配置文件和安装许多软件,因为自己对ubuntu没有深入的了解,出了一些问题就会重装系统。多装几次后总结了一些常用的配置和踩过的坑:

分区方案/bootboot分区,引导系统程序所需要的文件,,安装多个操作系统时用来引导/根分区/usr系统用户工具和程序/home用户目录swap分区 大小约等于内存的大小,相当于win下的虚拟内存更改root权限密码

刚安装好的ubuntu root权限密码需要激活

sudo passwd更新软件源

设置–>软件和更新–>更改服务器,取消掉下载源码选项会节省很多时间。

sudo apt-get update sudo apt-get upgrade删除不必要的软件

亚马逊等封装在ubuntu的软件对我们没用,在软件中新删除

安装搜狗拼音

检查是否安装fcitx,bssh

sudo apt-get install fcitx libsshdpkg -l|grep fcitxdpkg -l|grep libssh

去搜狗输入法官网下载安装,重启之后生效

配置java下载jdk配置环境变量sudo vim /etc/profileaddexport JAVA_HOME=your jdk direxport CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/libexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATHEXITsource /etc/profile/etc/environment与/etc/profile的区别 /etc/environment针对的时整个系统的设置,而/etc/profile针对/home目录下的用户 如果以上两个文件的配置相同,会在用户的桌面环境中显示/etc/profile中的配置安装GIT

git官网 git帮助

$ git help <verb>$ git <verb> –help$ man git-<verb>e.g.git help config

注意:使用代理或者无法连网的情况下git push -u origin master会报错:

correct access rightsand the repository exists.

我们可以停用代理或者修改ssh代替https SSH / Using SSH over the HTTPS port SSH / Error: Bad file number

ssh

ssh与git和github相关的配置 公钥和私钥

sshcd ~/.ssh将id_rsa.pub中的内容复制到github中测试ssh -T git@github.cominstall mysql

ubuntu自带的包版本和社区维护的版本有区别,一般官方社区维护的版本要比ubuntu团队的版本更新快,所以我们安装社区的版本

下载.deb文件,注意选择版本Adding the MySQL APT Repository Starting and Stopping the MySQL Server

shell> sudo service mysql status

Stop the MySQL server with the following command: shell> sudo service mysql stop

To restart the MySQL server, use the following command: shell> sudo service mysql start

修改mysql编码为UTF8

登录mysql

mysql -u root -p

输入密码 查看编码

“`shell

show variables like ‘%char%’ +————————–+—————————-+| Variable_name| Value|+————————–+—————————-+| character_set_client| utf8|| character_set_connection | utf8|| character_set_database | utf8|| character_set_filesystem | binary|| character_set_results | utf8|| character_set_server| utf8|| character_set_system| utf8|| character_sets_dir| /usr/share/mysql/charsets/ |+————————–+—————————-+

“`

修改编码 sudo vim /etc/mysql/my.cnf 在[client]下添加 default-character-set=utf8 [mysql] 下添加 default-character-set=utf8 [mysqld]下添加 character-set-server=utf8

注意这里的utf8千万不能写成utf-8,mysql的字符集不识别utf-8的

maven

去maven官网下载解压到制定目录即可

我的情况时这样的,之前ubuntu崩溃了,把里面的myeclipse和workspace拷贝出来重新安装ubuntu和maven,结果之前用maven管理的项目文件pom.xml报错: “`java CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to central (): No response received after 60000

伟人之所以伟大,是因为他与别人共处逆境时,

Linux configure for java web developer

相关文章:

你感兴趣的文章:

标签云: