How to get Process ID and Live Threads of a Java Application?
This is a simple Java Thread Life Cycle diagram for your reference. Below is a simple program which tells you how to get Process ID and Total # of Live Threads of a Java Application.package...
View ArticleJava: How to Get System Properties Information Programmatically?
Get system properties using System class. This example shows how to get system properties using System class. This example also shows how to get and print all system properties.package...
View ArticleSmartGit Setup Guide: My Favorite Client for Git and Mercurial
How to Setup SmartGit for your BitBucket / GitHub Repository? Let me 1st explain why I choose SmartGit for my ButBucket Git Repository… SmartGit/Hg’s main user interface is similar to those of typical...
View ArticleHow to Convert Time Between Timezone in Java?
TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a TimeZone using getDefault which creates a TimeZone based on the time zone where the program is...
View ArticleJava: How to Get Entity ContentType in HttpClient?
This code snippet show you how to get the content type of a result of executing an Http Get request. TheContentType can be obtained by using ContentType.getOrDefault() method and passing an HttpEntity...
View ArticleWhy Most Meetings are Wasteful: Causes For Wasteful Meeting
In theory, meetings are a wonderful tool. You get together with your colleagues, spitball ideas, pin down agendas, and have some quality face-to-face interactions. They’re as much an opportunity to...
View ArticleTop 5 Syntax Highlighter WordPress Plugins
1) Crayon Syntax Highlighter: This is my favorite plugin. A Syntax Highlighter built in PHP and jQuery that supports customizable languages and themes. It can highlight from a URL, a local file or...
View Article[WordPress] How to Deny Spambots From Comments
A spambot is an automated computer program designed to assist in the sending of spam. Spambots usually create fake accounts and send spam using them, although in many cases it would be obvious that a...
View ArticleWordPress: How to Create a Directory within the Uploads Folder
When developing a plugin or theme, it can be useful to be able to programmatically create a directory within the wp-content/uploads folder. Here is a handy piece of code to do it. Open functions.php...
View ArticleHow to Run Windows/Mac Commands in JAVA and Return the Text Result
Executing a system command is relatively simple – once you’ve seen it done the first time. It involves the use of two Java classes, the Runtime class and the Process class. Basically, you use the exec...
View ArticleHow to Configure BitBucket Git Repository in you Eclipse?
Bitbucket is a distributed version control system (DVCS) code hosting site that supports Mercurial and Git. With Mercurial and Git, your data is distributed by definition but you still need a place to...
View ArticleJava Properties File: How to Read config.properties Values in Java?
.properties is a file extension for files mainly used in Java related technologies to store the configurable parameters of an application. They can also be used for storing strings for...
View Articlejar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:...
Are you getting below exception? INFO: validateJarFile(c:\tomcat\Tomcat1\webapps\myApplication\WEB-INF\lib\servlet-api.jar) – jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:...
View ArticleHow to Run Java Program Automatically on Tomcat Startup
Recently I wanted to start my standalone Java Application on Tomcat Startup. Also found so many other related questions on net. i.e. I need to run an application that can run automatically that when...
View ArticleJava Properties Files: How to Update config.properties File in Java?
Properties files are a popular mean of configuring applications. Of course Commons Configuration supports this format and enhances significantly the basic java.util.Properties class. This section...
View ArticleHow to Resolve Exception HttpServlet cannot be resolved to a type
Are you getting “HttpServlet cannot be resolved to a type” while running your java program while starting Tomcat Server? Yes, I’m referring to this project:...
View ArticleHow to Get Tomcat Directory Path in Java
Let’s start with this program: http://crunchify.com/how-to-run-java-program-automatically-on-tomcat-startup/ We will use the same Java Program and modify it to give you Tomcat Directory Path in Java...
View ArticleHow to Change JVM Heap Setting (-Xms -Xmx) of Tomcat
-Xmxn - Specify the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2MB. Append the letter k or K to indicate kilobytes, or m or M to indicate...
View ArticleHow to get Ping Status of any HTTP End Point in Java?
I’m sure while working on Java Web Project, you must have faced these kind of questions: How to get HTTP response code for a URL in Java? How to check if a URL exists or returns 404 with Java? How can...
View ArticleHow to Run Multiple Threads Concurrently in Java? ExecutorService Approach
Let’s take a look at this example again: How to get Ping Status of any HTTP End Point in Java? Have you noticed the thread execution for that example? It’s sequential. What if you have 500 endpoints?...
View Article