LoginSignup
6

More than 5 years have passed since last update.

環境変数取得(Java)

Last updated at Posted at 2015-12-09

これ作ったからJavaのも作るかって思ったんだけど

Main.java
public class Class7 {
    public static void main(String[] args){
        String env = System.getenv("UserProfile");
        System.out.println(env);
    }
}

たったこれだけだったわorz
※分かりやすくするために2行にしました。

ちなみに、存在しない環境変数が指定された場合、nullが返るようです。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6