Skip to content

Instantly share code, notes, and snippets.

@cdimascio
Last active January 1, 2018 15:52
Show Gist options
  • Save cdimascio/cb5b1ab6aa083a3764fe8c4c9e84c898 to your computer and use it in GitHub Desktop.
Save cdimascio/cb5b1ab6aa083a3764fe8c4c9e84c898 to your computer and use it in GitHub Desktop.
Dotenv Java
# formatted as key=value
MY_ENV_VAR1=some_value
MY_EVV_VAR2=some_value
Dotenv dotenv = Dotenv.configure()
.directory("./some/path")
.ignoreIfMalformed()
.ignoreIfMissing()
.load();
dotenv.get("MY_ENV_VAR1")
import io.github.cdimascio.dotenv.Dotenv;
Dotenv dotenv = Dotenv.load();
dotenv.get("MY_ENV_VAR1")
dotenv.get("HOME")
val dotenv = dotenv {
directory = "./some/path"
ignoreIfMalformed = true
ignoreIfMissing = true
}
dotenv["MY_ENV_VAR1"]
import io.github.cdimascio.dotenv.dotenv
val dotenv = dotenv()
dotenv["MY_ENV_VAR1"]
dotenv["HOME"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment