Home > Java Core (page 3)

Java Core

SSL handshake alert: unrecognized_name Exception


This tutorial explains how to handle SSL handshake alert: unrecognized_name exception while calling an URL over SSL/https . When I tried to connect a web-server over SSL, I was getting the below error continuously. This happened with JDK1.7 and above. Below is the sample Java programme which I was running. Issue : Exception I was getting - Solution : After ... Read More »

URL shortening using google API


URL shortening using Google API Sometimes we need to share a long URL or we need to tweet them. But because of the length of the URL we are not able to do so. Google provides a service using which we can convert our long URL and squeezes them to fewer character URL. This service of Google is also known ... Read More »

GSON encoding the string like \u003d


This tutorial explains how to handle the encoding issue by using GSON. Below is a sample program in which GSON was converting string, with some special character, into some encoded character. But when we printed the GSON string it gave some different output other than what was supposed to be. The issue with the above code is GSON is encoding ... Read More »

How to encode decode String in Java base64 Encoding


Base64 Encoding Algorithm Base64 encodes String using an algorithm which uses 64 printable characters to replace each character in original string in an algorithmic sequence so that it can be decoded later. Base64 encoding prevents misuse of data by encoding it into ASCII format. Base64 is real simple and easy to use for simple encoding needs. There are more advanced ... Read More »

How to read and parse CSV file


This tutorial shows how to read, parse and print out the values from a CSV file. Say we have a CSV file user-profile.csv where the user name, roll number, age, course name is stored, seperated by comma. Sample file data Extracts the Roll Number and Course from above CVS file, and print it out. Read More »

What is Memory Leak & How can we avoid Memory Leak


Memory leak occurs when programmers create a memory in heap and forget to delete it. Memory leaks are particularly serious issues for programs which by definition never terminate. Usually developers talk about memory leaks but when you ask them what that means many have no idea. To prevent these situations, Lets discuss about memory lean in detail. Memory that is ... Read More »

How to install visualvm in Ubuntu


VisualVM is a visual tool, integrating several command line JDK tools and lightweight profiling capabilities. Designed for both production and development, it further enhances the capability of monitoring and performance analysis for the Java platform. VisualVM is designed for- Java Developer: Monitor, profile, take thread dumps, browse heap dumps. System Administrator: Monitor and control Java applications across the entire network. ... Read More »

Difference between JDK, JRE and JVM


If we are a Java developer, it is very often that we think about understanding the JRE,JVM and JDK. It would be quite easy for us to visualize things in logical manner. Let’s see the basic differences between the JDK, JRE and JVM. JDK (Java Development Kit) Java Developer Kit contains tools needed to develop the Java programs, and JRE ... Read More »

Create a Java project with Apache Maven


In this tutorial, we will learn how to create a Java project with Maven, imports it into the Eclipse IDE, and package the Java project into a jar file. Tools used : Maven 3.2.5 (For how to install, click here) Eclipse (Kepler Release) JDK 7 A. Create a Java Project from Maven Template In a terminal (*uix or Mac) or ... Read More »