How to get current working directory in java?

How to get current working directory in java?

You can get current working directory using System.getProperty(“user.dir”) function. Here current working directory means the root folder of your current Java project. Below java code shows how to get current working directory of user –   References: Oracle Java Docs for System Properties

Read More

How to write Exception’s PrintStackTrace to a File in Java?

How to write Exception’s PrintStackTrace to a File in Java?

Usually when you generate an exception in a Java program, you just print the exception to standard output using below code statement System.out.println(“Got an Exception: ” + e.getMessage()); But this is not what you want. Sometime you want to write Exception’s PrintStackTrace to a file and below Java program shows you how to write Exception’s …

Read More

Deploying a Java EE application on OpenShift Express with AS7 support

During the past few years, I’ve been hearing about “cloud” services more and more. Initially I wasn’t really curious to try them out. But a few months (a year?) back, I decided to see what it was all about. I have been involved with Java EE development for more than 7 years now, so I …

Read More