Build maven+eclipse+postgresql development environment under ubuntu

This process must be repeated every time the system is reinstalled, so make a note here.
1. Install the java environment. Mainly configure environment variables.
cd /etc/profile.d
sudo vi java.sh
export JAVA_HOME=/opt/jdk7
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

2. Anthropomorphic maven.
cd /etc/profile.d
sudo vi maven.sh
export MAVEN_HOME=/opt/maven3
export PATH=$PATH:$MAVEN_HOME/bin

3. Install eclipse.
Select eclipse-luna-jee.
4. The jms package is missing from the maven repository:
download from the link
mvn install:install-file -DgroupId=javax.jms -DartifactId=jms -Dversion=1.1 -Dpackaging=jar -Dfile=jms-1.1.jar


5.install postgresql
sudo apt-get install postgresql
sudo vi pg_hba.conf
local all all md5

sudo vi postgresql.conf
listen_addresses = '*'

sudo service postgresql restart
sudo passwd postgres

sudo -i -u postgres

createuser -s -P -l -e mydbuser

createdb mydb

psql
alter user postgres with password 'dbmaster';
alter user mydbuser with password 'passwd';
grant all on database mydb to mydbuser;


Switch to the system user
psql -U mydbuser -d mydb -W
test can enter and exit.

Import my sql file:
PGPASSWORD=pass psql -d mydb -U mydbuser -f my.sql








Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326341998&siteId=291194637