Java Tutorials, Tips & Tricks


Java is a programming language originally developed by Sun Microsystems and released in 1995 as a core component of Sun Microsystems’ Java. It is platform independent.

Playing with JVM / Java Heap Size.

Playing with JVM / Java Heap Size.
Java programs executes in JVM uses Heap of memory to manage the data. If your Java program requires a large amount of memory, it is possible that the virtual machine will begin to throw OutOfMemoryError instances when attempting to instantiate an object. The default heap size if 1 MB and can increase as much as 16 ...

Tutorial: Java Class file format, revealed…

Tutorial: Java Class file format, revealed...
In previous tutorial Java Virtual Machine, An inside story..., we saw some basic of internals of JVM and how it is divided into different components that helps in execution of Java byte code. Java Byte code as we saw is packed in a file called class file (with .class extension). In this tutorial let us see the internals of a class file. How the ...

Java Virtual Machine, An inside story!!

Java Virtual Machine, An inside story!!
Java Virtual Machine, or JVM as its name suggest is a "virtual" computer that resides in the "real" computer as a software process. JVM gives Java the flexibility of platform independence. Let us see first how exactly Java program is created, compiled and executed.Java code is written in .java file. This code contains one or more Java language attributes like Classes, Methods, Variable, Objects etc. ...

Create JAR file in Java & Eclipse

Create JAR file in Java & Eclipse
Let us see how to create a JAR file using Java's jar command as well as using Eclipse IDE. The JAR file format is based on the popular ZIP file format. Usually these file are used for archiving and distribution the files and implementing various libraries, components and plug-ins in java applications. Compiler and JVMs (Java Virtual Machine) can understand and implement these formats for ...
Tags: , ,

Implement LDAP authentication in Tomcat & JBoss server for Java app

Implement LDAP authentication in Tomcat & JBoss server for Java app
In this article we will explore the ways to implementation of LDAP (Lightweight Directory Access Protocol) authentication in Tomcat as well as JBoss server.First let us see briefly what LDAP is.Introduction to LDAPFollowing is what Wikipedia has to say about LDAP:The Lightweight Directory Access Protocol, or LDAP is an application protocol for querying and modifying directory services running over TCP/IP.A directory is a set of ...

RPC in Javascript using JSON-RPC-Java

RPC in Javascript using JSON-RPC-Java
Remote procedure call (RPC) in javascript is a great concept of creating rich web applications. First we will see some background about RPC using JavaScript Object Notation (JSON). See following quote from Wikipedia entry of JSON-RPC. JSON-RPC is a remote procedure call protocol encoded in JSON. It is a very simple protocol (and very similar to ...

Creating ZIP and JAR Files in Java

ZIP files offer a packaging mechanism, allowing multiple files to be bundled together as one. Thus, when you need to download a group of files from the web, you can package them into one ZIP file for easier transport as a single file. The bundling can include additional information like directory hierarchy, thus preserving necessary paths for an application or series of resources once unbundled.This ...

Apostrophe creating problem in properties file in java/struts

I encountered this problem with message resource property files in Struts. The problem is:I have an entry in property file where in it takes few arguements {0}, {1} etc.some.property.key = Hello {0}, Following is your account's detail. \ Please note that your registration no. {1} \ is going to expire on {2}, kindly login into your \ account {3} and update it.Now when I put the value for the ...

Files-Directory listing in Java

This example lists the files and subdirectories in a directory.File dir = new File("directoryName"); String; } } // It is also possible to filter the list of returned files. // This example does not return any files that start with ...

UnsupportedOperationException while removing or adding elements from List

Problem statement: While running following code, UnsupportedOperationException is thrown both at .add() and .remove() method. What is the problem with the code?List myNewList = Array.asList(someArrayOfLong); myNewList.add(new Long(15)); //add an element in the list. myNewList.remove(0); //remove element from the list at index 0.Solution: By the time you get to the remove(i) statement, list is no longer a java.util.ArrayList. When you call Arrays.asList it does not return a java.util.ArrayList. It returns ...
Page 6 of 6« First...23456
Copyright © 2012 ViralPatel.net. All rights reserved.