Linux configure for java web developer

Installing ubuntu requires configuration files and installing a lot of software, because I don't have a deep understanding of ubuntu, and if there are some problems, I will reinstall the system. After installing it a few times, I summarized some commonly used configurations and pitfalls:

partition scheme

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

Change root privilege password

The newly installed ubuntu root permission password needs to be activated

sudo passwd

update software source

Settings –> Software and Updates –> Change Server, canceling 下载源码the option will save a lot of time.

 sudo apt-get update
 sudo apt-get upgrade

remove unnecessary software

The software packaged in ubuntu such as Amazon is useless to us, and it is newly deleted in the software

Install Sogou Pinyin

Check if it is installed fcitx,bssh

sudo apt-get install fcitx libssh
dpkg -l|grep fcitx
dpkg -l|grep libssh

Go to Sogou and enter Judge.com to download and install, and it will take effect after restarting

Configure java

  • download jdk
  • Configure environment variables
sudo vim /etc/profile
add
export JAVA_HOME=your jdk dir
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
EXIT

source /etc/profile
  • The difference
    /etc/environmentbetween the settings of the entire system, but /etc/profilefor users in the /home directory.
    If the configurations of the above two files are the same, the settings in /etc/profile will be displayed in the user's desktop environment. configuration

install git

git official website
git help

$ git help <verb>
$ git <verb> --help
$ man git-<verb>

e.g.
git help config

Note: When using a proxy or failing to connect to the Internet, git push -u origin master will report an error:

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

We can disable the proxy or modify ssh instead of https SSH / Using SSH over the HTTPS port SSH / Error: Bad file number


ssh

ssh configuration related to git and github public
key and private key

ssh-keygen -t rsa -C "your email"
cd ~/.ssh
将id_rsa.pub中的内容复制到github中
测试
ssh -T git@github.com

install mysql

There is a difference between the package version of ubuntu and the version maintained by the community. Generally, the version maintained by the official community is updated faster than the version of the ubuntu team, so we install the version of the community

  1. Download the .deb file , pay attention to select the version
  2. Adding the MySQL APT Repository
    1. sudo dpkg -i mysql-apt-config_w.x.y-zubuntu14.04_all.deb
    2. During the installation of the package, you will be asked to choose the versions of the MySQL server and other components (for example, the MySQL Workbench) that you want to install. If you are not sure which version to choose, do not change the default options selected for you. You can also choose none if you do not want a particular component to be installed. After making the choices for all components, choose Apply to finish the configuration and installation of the release package.
    3. Selected packages can be reconfiguredsudo dpkg-reconfigure mysql-apt-config
  3. sudo apt-get update(Update software list) Click me to check which software packages have been updated
  4. sudo apt-get install package-name
  5. Installsudo apt-get install mysql-server

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

Modify mysql encoding to UTF8

log in to mysql

mysql -u root -p

Enter password
to view code

“`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/ |
+--------------------------+----------------------------+

“`

Modify the encoding
sudo vim /etc/mysql/my.cnf
Add default-character-set=utf8 under [mysql] Add default-character-set=utf8 under [mysqld] Add character-set-server=utf8[client]




Note thatutf8 it must not be written here utf-8, the character set of mysql does not utf-8recognize

maven

Go to the maven official website to download and unzip to the specified directory

My situation is like this. Before ubuntu crashed, I copied the myeclipse and workspace inside and reinstalled ubuntu and maven. As a result, the project file managed by maven reported an error: "`java CoreException: Could not calculate build pom.xmlplan
:
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 http://repo.maven.apache.org/maven2 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 (http://repo.maven.apache.org/maven2): No response received after 60000

Guess you like

Origin blog.csdn.net/u011387521/article/details/45343803