The Required Programs For Java Development Environment
JDK1.8.0_212
ref link:
https://stackoverflow.com/questions/9612941/how-to-set-java-environment-path-in-ubuntu
https://www.javahelps.com/2015/03/install-oracle-jdk-in-ubuntu.html (using JDK tar file)
https://www.javahelps.com/2015/03/install-oracle-jdk-in-ubuntu.html (using JDK tar file)
Setting the path for jdk1.8.0_212
or
sudo vi ~/.profile
Add following lines in end
export JAVA_HOME=/usr/bin/java
export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
log out and login so that the PATH is set .
to check the path you have set .. check the JAVA_HOME variable
Always
Always
source ~/.profile
source ~/.bashrc
echo $JAVA_HOME
which java
which java
java -version
So that the pc knows any changes have occurred in the respective files.
which java command to find the location of the java
mongoDB
tar -zxvf mongodb-linux-x86_64-3.2.22.tgz
mkdir -p mongodb cp -R -n mongodb-linux-x86_64-3.2.22/ mongodb
export PATH=(mongodb_install_directory)/bin:$PATH
replace the path with the install directory.
mySQL
sudo su (login to root)
mysql -u root -p
give password
mysql -u root -p
give password
postgreSQL
make
su
make install
root# mkdir /usr/local/pgsql/data
gedit ~/bashrc
exprot LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH
MANPATH=/usr/local/pgsql/share/man:$MANPATH
export MANPATH
sudo vim ~/.profile
export PATH=/usr/local/pgsql/bin:$PATHroot# chown postgres /usr/local/pgsql/data
(The chown command is used to change the owner and group of files, directories and links. By default, the owner of a filesystem object is the user that created it. The group is a set of users that share the same access permissions)
- root# su - postgres (in the root@adrian type in the following)
- postgres@adrian-pc:~$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
- sudo su - postgres (optional.no need of when logged on as the root)
- postgres -D /usr/local/pgsql/data >logfile 2>&1 &
- psql -h /var/run/postgresql
Differences between .bashrc and .profile
- bashrc will be executed after the system boot up and is for non-login shell. It is specific to bash
- profile will be executed after the user login. It's for login shell and can be read by different shells
- source bashrc can be used to update bashrc and bash profile can be used to update profile
- profile has the stuff not specifically related to bash, such as environment variables (PATH etc)
- bashrc has anything you'd want at an interactive command line. Command prompt, EDITOR variable, bash aliases etc
- bashrc must not output anything
- Anything that should be available only to login shells should go in profile
- Anything that should be available to graphical applications must be in profile check the sequence of the 3 files hierachy
Comments
Post a Comment