Created
April 19, 2010 22:22
-
-
Save jawspeak/371733 to your computer and use it in GitHub Desktop.
print out env variables in IDEA on mac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.jawspeak; | |
| import org.junit.Test; | |
| import java.io.BufferedReader; | |
| import java.io.InputStreamReader; | |
| import static org.junit.Assert.assertEquals; | |
| import static org.junit.Assert.assertNotNull; | |
| /** | |
| * Because maven expects to have env properties set, and they | |
| * need to be set in /etc/launchd.conf (or IntelliJ's startup script). | |
| */ | |
| public class EnvTest { | |
| @Test | |
| public void shouldPrintOutAllIntelliJProcessEnvironmentalVariables() throws Exception { | |
| Process p = Runtime.getRuntime().exec("/usr/bin/env"); | |
| int result = p.waitFor(); | |
| assertEquals(0, result); | |
| assertNotNull(p); | |
| BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream())); | |
| String s; | |
| while ((s = r.readLine()) != null) { | |
| System.out.println(s); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment