Pages

Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Thursday, September 4, 2014

Install Java in Chrome, Chromium or Firefox in Ubuntu

To enable Java plugin in your Linux browsers, just copy these lines into a script, and run it!

JAVA_HOME=/usr/lib/jvm/jdk1.7.0  or the path where you have installed java

MOZILLA_HOME=~/.mozilla mkdir$MOZILLA_HOME/plugins

For 32-bit systems :


ln -s $JAVA_HOME/jre/lib/i386/libnpjp2.so $MOZILLA_HOME/plugins

For 64-bit systems:

ln -s $JAVA_HOME/jre/lib/amd64/libnpjp2.so $MOZILLA_HOME/plugins

For running a script in linux use following commands:

1. Open terminal.

2. Go to the directory where you have created script. (Note: your file must have extension .sh. For example: file_name.sh )

3. Write following commands:  chmod +x <file_name>.sh

4. Now write ./<file_name>.sh

5. Restart your browser.

Install Oracle Sun JDK in Ubuntu and set JAVA_HOME

To install JDK from Oracle use following steps:

1. Download JDK from Oracle web site:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Extract file will be of .bin format. For example - for 64-bit system we have jdk-6u37-linux-x64.bin.

3. Put this bin file in your home directory.

4. Now need to extract this file to use Java API.

5. Extract BIN file:
  • Make BIN file executable using this command: chmod +x jdk***.bin
  • For executing use: ./jdk***.bin

6. Same named folder will be created in the same directory.

7. Now need to provide JDK path to JAVA_HOME variable in .bashrc file.

8. Edit .bashrc file in editor use following command:

          gedit .bashrc

9. Now put this code in your .bashrc file:

           export JAVA_HOME=/home/jdk***
           export PATH=$JAVA_HOME/bin:$PATH

10. Save file.

11. To refresh your bash settings write this command and hit enter:

            bash

12. To verify configured JDK path use this command:

            which java

This will display your configured path i.e. /home/jdk***/bin/java