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

 ALL


  Java AbstractMethodError explained and demonstrated

According to Oracle Java API documentation, AbstractMethodError is a kind of runtime error where the application is having some incompatible changes which leads to a missing implementation of an abstract method. Below is the official description.Thrown when an application tries to call an abstract method. Normally, this error is caught by the compiler; this error can only occur at run time if the definition of some class has incompatibly changed since the currently executing method was last compiled.Well this can happen in cases where there are inconsistent library upgrade. For example, if a l...

12,353 0       ABSTRACTMETHODERROR JAVA


  Convert JKS to BKS using keytool

There are lots of questions(question 1, question 2) on Stackoverflow about how to convert JKS keystore to BKS keystore(a keystore format provided by BouncyCastle) using Java keytool. The reason why this conversion gets lots of questions is that BKS is not a keystore format supported by Java SE, it's a third party keystore format. To convert JSK to BKS, the BKS provider has to be downloaded first. And a few more options needs to be added when running the keytool command.The typical command to convert JKS keystore to BKS keystore should look like below :keytool -importkeystore -srckeys...

18,805 3       JAVA SECURITY JKS KEYTOOL BKS


  Java development company briefs about Lazy and Eager fetch in JPA/Hibernate

Normal 0 false false false EN-IN X-NONE X-NONE

3,260 0       JAVA JAVA DEVELOPMENT COMPANY LAZY FETCH EAGER FETCH JPA HIBERNET


  Different types of keystore in Java -- BKS

BKS is a keystore format provided by the popular third party Java cryptographic library provider -- BouncyCastle. It is a keystore similar to the JKS provided by Oracle JDK. Before starting to use BKS, the BouncyCastle provider has to be downloaded and installed. To download the provider, please go to BouncyCastle download page. The provider can be installed by adding an entry in the java.security file.security.provider.N=org.bouncycastle.jce.provider.BouncyCastleProviderN means the provider index in the provider list.Creating BKS keystoreTo create a BKS keystore, you just need to create ...

31,161 0       JAVA KEYSTORE BOUNCYCASTLE BKS


  Generating CSR using Java

A CSR(Certificate Signing Request) is a kind of request generated by an application and is to be sent to a Certificate Authority to create a signed certificate which can be distributed. It usually contains certificate information such as subject name, public key info and signature info.In Java, keytool can be used to generate a certificate request with option -certreq.  But sometimes if an application wants to create a CSR programmatically, keytool will not do a favor, instead you should use APIs provided by Java to generate CSRs.Basically the steps to generate a CSR are :Get the key...

24,609 0       JAVA SECURITY CSR CERTIFICATE REQUEST


  Different ways to print "Hello world" in Java

This post is not about best practice to print "Hello world" in Java, it is about exploring different capabilities offered by Java. Also there are articles about printing "Hello world" in different programming languages, but this post is not about that.Standard literalThe most commonly used way is to use System.out to print"Hello world".System.out.println("Hello world");EnumerationAn enumeration can define a set of values belonging to one category. For example, an enumeration for all months in a year. Another great use of enumeration is in writing testcases to accept different testing para...

7,764 0       JAVA FEATURE


  Run executable jar on double click on Windows

Normally after installing Java, there will be an association between .jar and the javaw.exe. This enables the executable jar to be opened on double click. You can check the association by going to Control Panel -> Programs -> Default Programs -> Associate a file type or protocol with a program.The default program of a file type can be changed in this dialog. However sometimes there are cases where the file association for .jar may be altered after a third party application installed. The executable jar may not be able to be started normally post that and it still doesn't work eve...

25,856 3       JAVA WINDOWS JAR EXECUTABLE JAR


  Launch Java process programmatically in Java

In some cases while working on some automation testcase, developers would like to launch Java process programmatically so that the tests can be ran without manual intervention. Java provides such methods to achieve this.ProcessBuilder can be used to build a Java process which can be launched when everything is ready. Basically it can take a list of parameters which are similar to the command line options/arguments. For example, if you want to launch a Java process, you can do following.public final class JavaProcess { private String output = ""; private String javaHome = ""; public ...

8,235 0       JAVA COMMAND LINE PROCESSBUILDER