question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Env vars handling

See original GitHub issue

I am trying to migrate some code from java.lang.ProcessBuilder to ProcBuilder and have a few questions regarding env var handling.

  1. How can I control whether or not environment variables are inherited from the parent process? In java.lang.ProcessBuilder the default is to inherit all env vars and I can prevent this with a single call to: processBuilder.environment().clear()

  2. How can I set multiple env vars at once. Having to iterate over all vars and using the withVar(key, value) builder method defeats the purpose of fluent builder methods. So I am looking for a withVars(Map<String,String>) builder method or similar.

Thanks in advance!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
fleipoldcommented, Jan 23, 2022

Erledigt. 2.8.0 is on its way out to maven central.

0reactions
systemhaltedcommented, Jan 24, 2022

@fleipold Were you able to release the latest version to Maven Central?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Use Environment Variables the Right Way
For this article, I will be focusing on the 2 main flaws that I mostly encounter when dealing with environment variables:.
Read more >
How To Manage Environment Variables? - Humanitec
In this article, we talk with DevOps Engineer Antione Rougeot about the challenges of managing environment variables and he shares some best ...
Read more >
An Introduction to Environment Variables and How to Use Them
Exploiting environment variables is easy, but understanding their nuances and being able to efficiently and securely utilize them is one factor ...
Read more >
Handling Environment Variables - Jenkins
Special environment variables can change the behavior of build scripts: PATH (or Path on Windows) is generally used to find the programs that...
Read more >
Basic Features: Environment Variables - Next.js
Note: In order to keep server-only secrets safe, environment variables are evaluated at build time, so only environment variables actually used will be ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found