Skip to content

Instantly share code, notes, and snippets.

@jawspeak
Created April 19, 2010 22:22
Show Gist options
  • Select an option

  • Save jawspeak/371733 to your computer and use it in GitHub Desktop.

Select an option

Save jawspeak/371733 to your computer and use it in GitHub Desktop.
print out env variables in IDEA on mac
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