Posts Tagged ‘Java’

Install Oracle Java 8 in Linux Mint

Posted: March 3, 2017 in HowTo
Tags: , , , ,
To install Oracle Java 8, follow the steps below
Add the repository to the package list
$ sudo add-apt-repository ppa:webupd8team/java
Update packages in cache
$ sudo apt-get update
Install Java 8
$ sudo apt-get install oracle-java8-installer
Follow the instructions and verify the install as below
$ java -version



To convert string to date in java, use the following code.

public Date convertStringToDate(String dateStr)
   SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
      return dateFormat.parse(dateStr);
   catch (Exception e)
      return null;

Installing Sun Java 6 in Ubuntu 10.04

Posted: December 14, 2010 in HowTo
Tags: , , , ,

To install Sun Java 6, follow the steps below

Sun Java 6 has been moved canonical partner repository. To enable it run the below
$ sudo add-apt-repository "deb lucid partner"

Run below to update packages from recently enabled repository
$ sudo apt-get update

To install Sun Java 6 JDK, run the following
$ sudo apt-get install sun-java6-jdk

Accept the terms of agreement when asked and verify the install as below
$ java -version

To setup JRE for Firefox, a java plugin for the browser needs to installed. Run the following command to install Sun java browser plugin

$ sudo ssh apt-get install sun-java6-plugin

Once the install is complete, click on verify now to check the installation.