How to open the default mail client in Java

Open standard mail in JavaIn the following post there is once again a small Java code snippet, by means of which the standard mail program can be called/opened.
In order to open the standard mail application in almost any operating system, a URI with the mailto protocol is suitable. Therefore, the following Java code must be able to compose the mailto URI format.
The second difficulty is to resolve this URI (or in simple words – to execute this URI). Unfortunately, this can not be executed directly using the Runtime.getRuntime().exec()-command, but must be started as a parameter via a system-specific program. Our Java-Snippet must therefore be able to distinguish between the operating systems.
Open standard mail in Java
The sample code can be run as it is and opens the default mail program with a […]

How to detect operating system in Java

Detect operating system in javaIn the following article, there is a short Java snippet that can be used to read the operating system of the computer running the Java program.
In addition, it is the first Java snippet at all here in the blog. Although I have been writing a few lines of Java code again and again for a couple of years, I really couldn’t befriend myself (especially with regard to my C # passion) with Java so far yet. But since I have to deal more and more with Java on the job, however, this will soon be reflected in the blog. But let’s come to the Snippet now…
Read operating system in Java
In order to identify the computer’s operating system in Java, the getProperty-method of the system-class is suitable. […]