Java Try With Resource

A resource is an object that must be closed once the program is finished or done using it, for example, file resource, JDBC database connection resource, socket connection resource etc. Prior to Java 7, there was no auto resource management, we open the resource in a try block and close the resource in finally block. For example: try{ //open resources }catch(IOException){ //Exception handling }finally{ //close resource } In the above approach there were few drawbacks:

Read more 0

java7 install

If you are running an older version on java on your Ubuntu 12.04 environment, you must remove it before installing Java7. Do the following to remove: $sudo apt-get purge openjdk* If you installed java 7 earlier and having problem with java then you have to do the following to remove it: $sudo rm /var/lib/dpkg/info/oracle-java7-installer* $sudo apt-get purge oracle-java7-installer* $sudo rm /etc/apt/sources.list.d/*java* $sudo apt-get update Installing Oracle Java7 on Ubuntu 12.04 LTS: $sudo add-apt-repository ppa:webupd8team/java $sudo

Read more 0