Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 JAVA


  Remote execute command in Java example

Frequently there is a need to logon to a remote system and run some commands or programs to get the output, many software can serve this purpose such as putty and gitshell.These software usually provide secure access to the remote system. But have you ever wondered what to do if you need to run commands on many different systems at the same time and get all these results back at a single place? Especially in big data era, many tasks may run on different distributed systems and you want o have a single place to accumulate the result.In this post, we will introduce a Java library which can help ...

45,583 11       JSCH EXAMPLE DISTRIBUTED SYSTEM SSH2


  Use Memory Analyzer Tool in Eclipse

When developing applications, we often encounter memory issues of an application. To analyze how much memory each class takes, we need to have some specific tools to assist us. One of them is Memory Analyzer Tool on Eclipse.The Eclipse Memory Analyzer is a fast and feature-rich Java heap analyzer that helps you find memory leaks and reduce memory consumption.To use the Memory Analyzer Tool, you first need to install it on Eclipse. You can go to Help -> Install New Software.... Paste  http://download.eclipse.org/mat/1.4/update-site/ in Work with field and press Enter. Then follow the st...

12,988 1       MEMORY ANALYZER TOOL ECLIPSE HEAP DUMP HPROF


  ConcurrentHashMap vs Collections.synchronizedMap()

ConcurrentHashMap and Collections.synchronizedMap() both provide thread-safe operations of collections of data. They are used in multithreaded programs to provide both thread safety and performance improvements. In many cases, we can use either of them.But the realization of thread safety is different for these two implementations. ConcurrentHashMap will create an HashEntry[] array internally to store the elements passed in from a Map, while Collections.synchronizedMap() will return a SynchronizedMap.The main difference between these two is that ConcurrentHashMap will lock only portion of the ...

56,315 1       CONCURRENTHASHMAP COLLECTIONS.SYNCHRONIZEDMAP


  Different types of keystore in Java -- JKS

JKS is Java Keystore, a proprietary keystore type designed for Java. It can be used to store private keys and certificates used for SSL communication, it cannot store secret keys however. The keytool shipped with JDKs cannot extract private keys stored on JKS. This type of keystore usually has an extension of jks.Next we will show how to operate the JKS keystore with pure Java code.Create JKS keystoreThe simplest method to create a JKS keystore to create an empty keystore. We can first get an instance of KeyStore and then load a null keystore. After loading the null keystore, we just need to c...

45,270 3       DEMO EXAMPLE KEYSTORE JKS


  IDEs for Java programmers

IDEs are great helpers to programmers. They can help programmers write less error-prone programs with less time. They have become an inevitable part of many programmers. As a Java developer, you may be familiar with Eclipse already. But do you know other IDEs for Java programmers?We will give an overview of different IDEs for Java programmers. These IDEs are Eclipse, Intellij IDEA, NetBean and BlueJ.EclipseEclipse is the most widely used IDE for Java programmers. It's an open source IDE which is originally developed by IBM. Now it can not only be used to write Java programs, but also C++, C, J...

8,600 4       ECLIPSE JAVA IDE BLUEJ NETBEANS


  Understanding abstract interface in Java

Have you read about an interface declaration as public abstract interface InterfaceName in Java? At the first glance, is it a weird declaration? Why should we declare an interface as abstract? For example, we may see below code in some projects:public abstract interface MyInterface { public void check(); public abstract boolean check(boolean really);}Actually here abstract is redundant, an interface is implicitly abstract, we no need to put an abstract in front of interface. But it does no harm if you do.You can find the below statement about abstract interface in JLS:9.1.1.1 abstra...

4,395 0       JAVA ABSTRACT INTERFACE


  Different types of keystore in Java -- Overview

Keystore is a storage facility to store cryptographic keys and certificates. They are most frequently used in SSL communications to prove the identity of servers and clients. A keystore can be a file or a hardware device. Three are three kinds of entries can be stored in a keystore depending on the types of keystores.The three types of entries are:PrivateKey : This is a type of keys which are used in asymmetric cryptography. It is usually protected with password because of its sensitivity. It can also be used to sign a digital signature.Certificate : A certificate contains a public key which c...

135,653 4       JAVA KEYSTORE OVERVIEW JKS PKCS12 JCEKS PKCS11 DKS BKS


  Generate certificate in Java -- Certificate chain

In previous post, we have introduced the use of Certificate and how to generate self signed certificate using Java. In this post, we will show you how to generate a certificate chain. Sometimes we may only have a certificate request or we don't have a trusted certificate which can be used for business. Now we need to have a trusted CA to sign our certificate so that it can be used on SSL communications.To generate a certificate chain, we may first have our own certificate(A), then we may use other certificate(B) and its associated private key to sign the certificate we have, then we will use a...

40,500 2       JAVA CERTIFICATE CHAIN CREATION PURE JAVA