Thursday, February 26, 2015

Java get system environment variable details

Get System environment variable details.

import java.util.Map;

/**
 *
 * @author Uttesh Kumar T.H.
 */
public class FindJdk {

    public static void main(String[] args) {
        Map<String, String> env = System.getenv();
        for (String envName : env.keySet()) {
            System.out.format("%s=%s%n",envName,env.get(envName));
        }
    }
}


Related Posts:

  • Spring + JPA + Hibernate Sample IntroductionStand-alone Spring application sample, Spring framework supports the persistence layer to be fully implemented through JPA. Simple example of configure the Spring needed components to perform persistence over sta… Read More
  • Java get system environment variable detailsGet System environment variable details. import java.util.Map; /** * * @author Uttesh Kumar T.H. */ public class FindJdk { public static void main(String[] args) { Map<String, String> env = System.gete… Read More
  • 6 Steps for contribute your jar/project to open source maven repository Prerequisites: 1. Sign Up at Sonatype. 2. Create your project in JIRA. 3. Create a Key Pair. 4. Create and Sign your Artifacts. 5. Deploy your Artifacts to your Staging Repository. 6. Promote your Repository Step #1: Sign Up… Read More
  • Generate PDF page as imageWe can generate the image of pdf page by using the Pdf-renderer Simple class which generate the images file of given pdf file. /* * To change this license header, choose License Headers in Project Properties. * To change … Read More
  • Command execution by Java Processorsample code to execute any command on operating system by using java processor. for example : To find jdk installed in system, We can run the command "where javac" for window and "where is javac" for linux the above command… Read More

0 comments:

Post a Comment