<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Diana 🦪</title>
    <description>The latest articles on Forem by Diana 🦪 (@dianasoyster).</description>
    <link>https://forem.com/dianasoyster</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F733804%2F08a568d6-da3e-4472-a2af-adac609fced1.jpg</url>
      <title>Forem: Diana 🦪</title>
      <link>https://forem.com/dianasoyster</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/dianasoyster"/>
    <language>en</language>
    <item>
      <title>Migration from Twilio to Vonage Video: Guides for Web, iOS, and Android</title>
      <dc:creator>Diana 🦪</dc:creator>
      <pubDate>Tue, 14 May 2024 11:35:55 +0000</pubDate>
      <link>https://forem.com/vonagedev/migration-from-twilio-to-vonage-video-guides-for-web-ios-and-android-4524</link>
      <guid>https://forem.com/vonagedev/migration-from-twilio-to-vonage-video-guides-for-web-ios-and-android-4524</guid>
      <description>&lt;p&gt;In case you missed it, Vonage is &lt;a href="https://developer.vonage.com/en/blog/vonage-welcomes-twilio-programmable-video-customers" rel="noopener noreferrer"&gt;welcoming Twilio Programmable Video customers&lt;/a&gt; to switch to using the Vonage Video API! Don't worry; we wouldn't invite you over without providing resources for the migration. This blog will share our newest migration guides for &lt;a href="https://developer.vonage.com/en/video/guides/migration-guides/twilio/web?source=video" rel="noopener noreferrer"&gt;Web (JavaScript)&lt;/a&gt;, &lt;a href="https://developer.vonage.com/en/video/client-sdks/android/overview?source=video" rel="noopener noreferrer"&gt;Android&lt;/a&gt;, and &lt;a href="https://developer.vonage.com/en/video/guides/migration-guides/twilio/ios?source=video" rel="noopener noreferrer"&gt;iOS&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Difference
&lt;/h2&gt;

&lt;p&gt;There's no debate that Twilio and Vonage share many concepts. The main difference is that, with Twilio, you have to create a room SID, while with Vonage, you create a sessionID. You then create authentication tokens used in the Vonage client SDKs to connect to a session. Once connected, clients can publish video/audio media streams and subscribe to the other client streams to create their real-time video applications. &lt;/p&gt;

&lt;h2&gt;
  
  
  Web (JavaScript) Migration
&lt;/h2&gt;

&lt;p&gt;Vonage offers our Web developers and JavaScript fans the option to migrate their preexisting Twilio Video Web implementation to Vonage &lt;a href="https://developer.vonage.com/en/video/overview" rel="noopener noreferrer"&gt;Video API&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The Vonage Video API is a customizable option that allows developers to integrate real-time video capabilities into their applications, covering 1:1 video calling, group video chat, and large-scale interactive broadcasts. It provides a set of APIs for building customized features such as dynamic video recording, SIP interconnect, signaling, and live captions. It also offers a range of customization options, allowing developers to tailor the UX and UI to fit their application's design. We provide a &lt;a href="https://developer.vonage.com/en/video/guides/migration-guides/twilio/web?source=video" rel="noopener noreferrer"&gt;Twilio migration guide&lt;/a&gt; with simple steps to quickly switch from Twilio and build video chat and multiparty applications using the Vonage Video API.&lt;/p&gt;

&lt;h2&gt;
  
  
  iOS and Android Guides
&lt;/h2&gt;

&lt;p&gt;The Vonage Video API provides client SDKs for various platforms, including iOS and Android that Twilio supported. (In fact, Vonage also supports Windows, Linux and MacOS). The &lt;a href="https://developer.vonage.com/en/video/client-sdks/ios/overview" rel="noopener noreferrer"&gt;iOS SDK&lt;/a&gt; allows developers to integrate real-time video communication features into their iOS applications, including iPhones and iPads. The &lt;a href="https://developer.vonage.com/en/video/client-sdks/android/overview?source=video" rel="noopener noreferrer"&gt;Android SDK&lt;/a&gt; offers the same capabilities with Android devices. By following these migration guides for &lt;a href="https://developer.vonage.com/en/video/guides/migration-guides/twilio/ios?source=video" rel="noopener noreferrer"&gt;iOS&lt;/a&gt; and &lt;a href="https://developer.vonage.com/en/video/guides/migration-guides/twilio/android?source=video" rel="noopener noreferrer"&gt;Android&lt;/a&gt;, you can convert your entire Twilio application to Vonage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Come for the Video, Stay for APIs
&lt;/h2&gt;

&lt;p&gt;Vonage offers more than just the Video API. We also offer Text, Messaging, Voice, Authentication, and other APIs for developers to build with. After being acquired by Ericsson, we've been growing and expanding our APIs with new 5G network-base capabilities and want you to be a part of it. Feel free to &lt;a href="https://developer.vonage.com/en/community/slack" rel="noopener noreferrer"&gt;join our community Slack&lt;/a&gt; and &lt;a href="https://twitter.com/VonageDev" rel="noopener noreferrer"&gt;follow us on X&lt;/a&gt;, formerly known as Twitter. If you end up trying out our migration guides and building with Vonage, please share them and &lt;a href="https://twitter.com/dianasoyster" rel="noopener noreferrer"&gt;tag me&lt;/a&gt; - I'd love to hear about your experience!&lt;/p&gt;

</description>
      <category>video</category>
    </item>
    <item>
      <title>Working with Environment Variables in Java</title>
      <dc:creator>Diana 🦪</dc:creator>
      <pubDate>Fri, 22 Mar 2024 13:09:44 +0000</pubDate>
      <link>https://forem.com/vonagedev/working-with-environment-variables-in-java-1n8o</link>
      <guid>https://forem.com/vonagedev/working-with-environment-variables-in-java-1n8o</guid>
      <description>&lt;h2&gt;
  
  
  What is an Environment Variable?
&lt;/h2&gt;

&lt;p&gt;Environment variables (sometimes called "env vars") are variables you store outside your program that can affect how it runs. You can later use that value to change how programs, applications, and services behave. Applications treat environmental variables like constants (a value that does not change during the program's execution) rather than mutable variables (a value that can change). They are best used with things you would typically consider hard coding but would rather keep the value out of your code, either because it will change between environments. You want to keep your code portable and easier to manage because you want to avoid leaking sensitive information such as your API key and password in less secure environments like development or testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Cases
&lt;/h2&gt;

&lt;p&gt;Here are a few use cases for environmental variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Defining program arguments&lt;/li&gt;
&lt;li&gt;Specifying domain names&lt;/li&gt;
&lt;li&gt;Storing API keys&lt;/li&gt;
&lt;li&gt;Setting path variables&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s dive into each!&lt;/p&gt;

&lt;h3&gt;
  
  
  Defining Program Arguments
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How It Works&lt;/strong&gt;: Developers use environment variables like &lt;code&gt;ENV_MODE&lt;/code&gt; to indicate the current execution context of the application, such as development, testing, staging, or production.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benefits&lt;/strong&gt;: This allows the application to adapt its behavior based on the mode. For instance, in development mode, the application might enable verbose logging and debugging tools, whereas in production, these features are disabled for efficiency and security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implementation Example&lt;/strong&gt;: In Java, you might check &lt;code&gt;System.getenv("ENV_MODE")&lt;/code&gt; to configure database connections or error handling differently for each mode.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Specifying Domain Names
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How It Works&lt;/strong&gt;: Environment variables like &lt;code&gt;SERVICE_URL&lt;/code&gt; can store domain names or URLs that the application might need to access.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benefits&lt;/strong&gt;: This is particularly useful for applications that interact with different endpoints or services in different environments. By changing the environment variable, you can redirect your application to use a different domain without altering the code.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implementation Example&lt;/strong&gt;: In a Java-based web application integrating Vonage services, the endpoint URL for Vonage's API can be defined using an environment variable, like &lt;code&gt;VONAGE_API_URL&lt;/code&gt;. This allows developers to switch between a local development environment and a production server by simply changing the value of the environment variable. The application retrieves this URL with &lt;code&gt;System.getenv("VONAGE_API_URL")&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Storing API Keys
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How It Works&lt;/strong&gt;: Sensitive information such as API keys can be stored in environment variables, for instance, &lt;code&gt;API_KEY&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benefits&lt;/strong&gt;: This practice keeps sensitive data out of the source code, enhancing security. It also makes it easy to update keys without needing to touch the codebase, and different keys can be used in different environments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implementation Example&lt;/strong&gt;: In a Java application using Vonage services, the Vonage API key can be stored in an environment variable, such as &lt;code&gt;VONAGE_API_KEY&lt;/code&gt;. To access this key, the application would use &lt;code&gt;System.getenv("VONAGE_API_KEY")&lt;/code&gt;. This approach ensures the API key is not embedded in the source code or exposed in version control, enhancing security while providing access to Vonage's telecommunication services.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Setting Path Variables
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How It Works&lt;/strong&gt;: Environment variables like LOG_PATH or CONFIG_DIR can be used to specify the application's directory paths for logging, configuration files, or other purposes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benefits&lt;/strong&gt;: This allows for flexible file management, as paths can be changed per environment without code changes. It’s beneficial for applications on multiple platforms (like Windows and Unix), where directory structures can vary significantly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Implementation Example&lt;/strong&gt;: In a Java application, reading a configuration path from an environment variable allows it to quickly adapt to different file system layouts across development and production servers or operating systems.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In all these cases, environment variables provide a layer of abstraction that separates configuration details from the application logic. This separation not only enhances security and maintainability but also increases the adaptability of the software to different environments and conditions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Environmental Variables
&lt;/h2&gt;

&lt;p&gt;Accessing environment variables in Java is straightforward and can be done using the System class provided by the standard Java library. Here's a simple guide on how to do it:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Get a Single Environment Variable&lt;/strong&gt;: Use the System.getenv(String name) method to retrieve the value of a specific environment variable. For example, to access an environment variable named &lt;code&gt;API_KEY&lt;/code&gt;, you would use:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;apiKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getenv&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"API_KEY"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Check for Null Values&lt;/strong&gt;: It's a good practice to check if the environment variable is null (i.e., not set) to avoid potential NullPointerExceptions. For example:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;apiKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Optional&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofNullable&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getenv&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"API_KEY"&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;&lt;span class="na"&gt;orElse&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;otherValue&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;otherValue&lt;/code&gt; is the fallback. You can throw an exception instead if the environemnt variable is missing like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Optional&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ofNullable&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getenv&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"API_KEY"&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;&lt;span class="na"&gt;orElseThrow&lt;/span&gt;&lt;span class="o"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;IllegalStateException&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"API_KEY env var is not defined"&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Get All Environment Variables&lt;/strong&gt;: To get a &lt;code&gt;Map&amp;lt;String, String&amp;gt;&lt;/code&gt; of all environment variables, use &lt;code&gt;System.getenv()&lt;/code&gt;. This is useful if you want to iterate over all available environment variables. For example:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;envVars&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getenv&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;envName&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;envVars&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;keySet&lt;/span&gt;&lt;span class="o"&gt;())&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;format&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"%s=%s%n"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;envName&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;envVars&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;envName&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;&lt;span class="err"&gt;`&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, this can be written in one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getenv&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;forEach&lt;/span&gt;&lt;span class="o"&gt;((&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s"&gt;"="&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;v&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Setting Environmental Variables
&lt;/h2&gt;

&lt;p&gt;Setting environment variables directly within a Java application is not straightforward because environment variables are typically set at the operating system level and are read-only without an argument. However, there are a few ways you can work around this limitation, depending on your use case:&lt;/p&gt;

&lt;h3&gt;
  
  
  Set Environment Variables Before Running Java Application
&lt;/h3&gt;

&lt;p&gt;The most common approach is to set environment variables in your operating system before starting your Java application. This can be done in the command line or through scripts.&lt;/p&gt;

&lt;p&gt;For example, in a Unix environment, you can set an environment variable in the terminal like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;MY_VAR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"some value"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Windows Command Prompt, it would be:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;set MY_VAR=some value&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Set for Sub-Processes
&lt;/h3&gt;

&lt;p&gt;If you need to set environment variables for &lt;a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ProcessBuilder.html" rel="noopener noreferrer"&gt;subprocesses&lt;/a&gt; started from your Java application (and not for the Java process itself), you can use the ProcessBuilder class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;ProcessBuilder&lt;/span&gt; &lt;span class="n"&gt;processBuilder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ProcessBuilder&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="nc"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;env&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;processBuilder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;environment&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;put&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"MY_VAR"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"some value"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;Process&lt;/span&gt; &lt;span class="n"&gt;process&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;processBuilder&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;start&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Set Environment Variables in IDE
&lt;/h3&gt;

&lt;p&gt;If you are using an Integrated Development Environment (IDE) like &lt;a href="https://www.jetbrains.com/idea/" rel="noopener noreferrer"&gt;IntelliJ IDEA&lt;/a&gt; or &lt;a href="https://www.eclipse.org/ide/" rel="noopener noreferrer"&gt;Eclipse&lt;/a&gt;, you can set environment variables in the configuration settings of your application.&lt;/p&gt;

&lt;h3&gt;
  
  
  Set Environment Variables in Build Tools
&lt;/h3&gt;

&lt;p&gt;When using build tools like &lt;a href="https://maven.apache.org/" rel="noopener noreferrer"&gt;Maven&lt;/a&gt; or &lt;a href="https://gradle.org/" rel="noopener noreferrer"&gt;Gradle&lt;/a&gt;, you can configure environment variables in the build scripts or configuration files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Loading Configurations From a File
&lt;/h2&gt;

&lt;p&gt;Since &lt;code&gt;java.util.Properties&lt;/code&gt; implements the Map interface, you can load any file which maps key-value pairs like so, irrespective of its file extension:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;props&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Properties&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;envFile&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Paths&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"/path/to/MyEnvConfig.env"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;inputStream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Files&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;newInputStream&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;envFile&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;props&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inputStream&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;apiKey&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;props&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"VONAGE_API_KEY"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;apiSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;props&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"VONAGE_API_SECRET"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Share Your Best Practices
&lt;/h2&gt;

&lt;p&gt;Getting and setting environment variables is an essential part of creating production software. If you’ve reached the end of this article, you’re now familiar with what environment variables are, use cases, how to get and set environment variables, and using .env files in Java. Feel free to join our community &lt;a href="https://developer.vonage.com/en/community/slack" rel="noopener noreferrer"&gt;Slack&lt;/a&gt; and follow us on &lt;a href="//twitter.com/VonageDev"&gt;X&lt;/a&gt;, formerly known as Twitter. Do you have other best practices using environmental variables? Please share them and &lt;a href="//twitter.com/dianasoyster"&gt;tag me&lt;/a&gt; - I'd love to hear about them!&lt;/p&gt;

</description>
      <category>java</category>
    </item>
    <item>
      <title>Things I asked the DevAd hiring manager before verbally accepting the intern offer</title>
      <dc:creator>Diana 🦪</dc:creator>
      <pubDate>Sun, 02 Jan 2022 04:24:21 +0000</pubDate>
      <link>https://forem.com/dianasoyster/things-i-asked-the-devad-hiring-manager-before-verbally-accepting-the-intern-offer-1b5h</link>
      <guid>https://forem.com/dianasoyster/things-i-asked-the-devad-hiring-manager-before-verbally-accepting-the-intern-offer-1b5h</guid>
      <description>&lt;p&gt;As I prepare for my third and last internship before graduation, I thought it would help to articulate details I needed to know about a role before signing my soul away.&lt;/p&gt;

&lt;p&gt;I had the luxury of meeting with my future manager a few times before making my decision, so I made sure each call was productive and insightful since I only had those moments to decide if vibes check out.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is the intern project?
&lt;/h2&gt;

&lt;p&gt;I've learned to run for the hills when a hiring manager is extremely vague or even unsure about what they want me to work on. First, it comes off open-minded and flexible which is really intriguing. But then I find myself gaslit and working on something I absolutely did not want to do.&lt;/p&gt;

&lt;p&gt;I'd love to know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What product I'll be working with&lt;/li&gt;
&lt;li&gt;What specific topics I'll be covering&lt;/li&gt;
&lt;li&gt;What my final project will be&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I've narrowed my choices of employers based on (1) products that interest me and (2) projects assigned. I learned I don't make a good sellout, and there was no way I'd make a decent devad if I wasn't working on something I enjoyed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why are you hiring an intern specifically on this team?
&lt;/h2&gt;

&lt;p&gt;I was once brought onto a team as an impromptu intern (ie. they made my role because I was referred). During my first week, I approached my manager with a list of clarifying questions including "What are your expectations of me in order to get a return offer on this team?" &lt;em&gt;(Something I was taught to ask early on and a previous internship had addressed on my first day)&lt;/em&gt; Had I not asked this, I probably wouldn't have ever learned that &lt;strong&gt;this team wasn't even hiring&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That conversation turned into a real sh!t show, but my point is: Please don't bring an intern on without intent to keep them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is mentorship offered? If yes, what's your style?
&lt;/h2&gt;

&lt;p&gt;When hearing about my classmates who interned at Amazon, I envied the kind of mentorship they received. It was very organized and systematic, and expectations of the mentor were crystal clear. I never felt like I really had that. It's not their fault; none of my assigned mentors were given instructions on how to contribute to my internships. Some of them didn't even know what being a mentor entailed.&lt;/p&gt;

&lt;p&gt;Ideally I would like an empathetic mentor(s) who can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;willingly take on questions&lt;/li&gt;
&lt;li&gt;train me but understand I'm likely unable to perform at their level in the time I'm interning&lt;/li&gt;
&lt;li&gt;help unblock me after I've tried to solve a problem&lt;/li&gt;
&lt;li&gt;offer constructive feedback (I don't want to think I'm doing fine then get blindsided)&lt;/li&gt;
&lt;li&gt;offer the amount of guidance I need&lt;/li&gt;
&lt;li&gt;carve out time to have involved 1:1's; if they're busy, we can move it (I don't want a mentor who is constantly working on other things every time we meet while I'm trying to talk to them)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What are the expectations to get a return offer?
&lt;/h2&gt;

&lt;p&gt;I was once told it was "extremely off-putting" that I had asked about &lt;em&gt;what is expected of me in order to get a return offer&lt;/em&gt; because it came off "entitled that I even thought it was a possibility to return to the team." I hated that I tip-toed around this question for countless talks every since, but I've spoken to enough people now to confirm that &lt;strong&gt;that isn't an offensive question and it's completely normal to want to know this information&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I asked if we could establish some metrics we can refer to (e.g. How many videos am I expected to make?), so I have some level of self-awareness. I get that solely reaching a count isn't all it takes, but I just want some way of knowing how much I've done and how much I have left to do.&lt;/p&gt;

&lt;h2&gt;
  
  
  Are you crazy? (Please don't ask this verbatim)
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;"I just wanted to make sure you're not crazy."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Lacks context but yes...I did actually say the above sentence verbatim.&lt;/p&gt;

&lt;p&gt;Admittedly, it was unnecessarily vulnerable to share my story about being expected to work normally after 3 deaths in my family during a past internship. I'm sure there were other ways to find out whether my next boss understands that "life happens" and I'm a human-being before I'm an employee.&lt;/p&gt;

&lt;p&gt;My point is: this was important to me, and I needed some reasurrance that I was going to work for a reasonable person.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrap up
&lt;/h2&gt;

&lt;p&gt;When I got the offer, I had already chosen the company based on their size, pay, benefits, etc. The only thing left was choosing my manager.&lt;/p&gt;

&lt;p&gt;My key determining factors when deciding on a manager were their:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;assigned project&lt;/li&gt;
&lt;li&gt;purpose for hiring an intern&lt;/li&gt;
&lt;li&gt;mentorship style&lt;/li&gt;
&lt;li&gt;expectations&lt;/li&gt;
&lt;li&gt;response to emergencies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Can't wait to share my journey as a DevAd intern at Snowflake starting in February!&lt;/p&gt;

</description>
      <category>intern</category>
      <category>devrel</category>
      <category>firstpost</category>
    </item>
  </channel>
</rss>
