November 6th

3rd Day in Internship

Assignment

1. Install & verify JDK 1.7 & 1.8.
First we have to check the command in terminal is : java -version

After that from the shared folder I got the JDK 1.7 & JDK 1.8 files.

After the extraction of those files

I followed these commands

1.sudo gedit /etc/profile

2. then add these things to the editable file.(for JDK 1.7 )

JAVA_HOME=/usr/local/java/jdk1.7.0_45
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH

3. sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.7.0_45/bin/java" 1

4. sudo update-alternatives --set java /usr/local/java/jdk1.7.0_45/bin/java



After these steps we can install the JDK.
2. Write a java program using a text editor and use javac, java command to compile and execute.
I have done this by creating the .java extension gedit java file and compile it and run it.

3. Create OS aliases to switch between java7 & java8.
 We want to add these under ~/.bashrc file
     # Alias
alias j7='PATH=/home/kausik/Install/Java/jdk1.7.0_80/bin:$PATH'
alias j8='PATH=/home/kausik/Install/Java/jdk1.8.0_74/bin:$PATH'

then we can switch between the JDK versions.


4. Install & verify Mysql 5.5 & 5.6 both using binary distribution in '/usr/local/' path according to the instructions given inside the relevant binary distribution.

I followed these Steps.
Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
  • Delete the MySQL profile
sudo rm /etc/mysql/ -R
  • Automatically uninstall mysql
sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor
  • Download version 5.5.51 from MySQL site
wget https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz
  • Add mysql user group
sudo groupadd mysql
  • Add mysql (not the current user) to mysql user group
sudo useradd -g mysql mysql
  • Extract  to /usr/local
sudo tar -xvf mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz /usr/local/
  • Create mysql folder in /usr/local by moving the untarred folder
cd /usr/local
sudo mv mysql-5.5.49-linux2.6-x86_64 mysql
  • Set mysql directory owner and user group
cd mysql
sudo chown -R mysql:mysql *
  • Install the required lib package (works with 5.6 as well)
sudo apt-get install libaio1
  • Execute mysql installation script
sudo scripts/mysql_install_db --user=mysql
  • Set mysql directory owner from outside the mysql directory
sudo chown -R root .
  • Set data directory owner from inside mysql directory
sudo chown -R mysql data
  • Copy the mysql configuration file
sudo cp support-files/my-medium.cnf /etc/my.cnf (mysql 5.5)
sudo cp support-files/my-default.cnf /etc/my.cnf (mysl 5.6)
  • Start mysql
sudo bin/mysqld_safe --user=mysql &
sudo cp support-files/mysql.server /etc/init.d/mysql.server
  • Initialize root user password
sudo bin/mysqladmin -u root password '[your new password]'
  • Add mysql path to the system
sudo ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
  • Reboot!
  • Start mysql server
sudo /etc/init.d/mysql.server start
  • Enable myql on startup
sudo update-rc.d -f mysql.server defaults
Disable mysql on startup (Optional)
sudo update-rc.d -f mysql.server remove
  • REBOOT!
  • Now directly use the command below to start mysql if it hasn’t
sudo service start mysql -u root -p



5. After installation you should be able to switch between mysql 5.5 & 5.6 by changing the link to '/usr/local/mysql'.
        I have done this by creating a link between mysql5.5 and mysql5.6.
        Then we can change the link to different versions and we can      
        switch between different versions.

6. Configure mysql to start at OS startup.
    Enable myql on startup
   sudo update-rc.d -f mysql.server defaults
   Disable mysql on startup (Optional)
   sudo update-rc.d -f mysql.server remove

7. Install Intellij IDEA.
To do this first I have downloaded the Intellij IDEA community version tar file.
After extracting that tar . I have to go to the idea-IC-172.4343.14/bin path and I gave the ./idea.sh command to install the intellij IDEA

8. Create a Java Project Using Intellij idea.
I have done this by creating a new JAVA project with the intellij IDEA.


0 Comments