About 265,000 results
Open links in new tab
  1. How do I set environment variables from Java? - Stack Overflow

    How do I set environment variables from Java? I see that I can do this for subprocesses using ProcessBuilder. I have several subprocesses to start, though, so I'd rather modify the current process's environment and let the subprocesses inherit it. There's a System.getenv(String) for getting a single environment variable.

  2. How to set the environment variables for Java in Windows

    Notice that these environment variables are derived from the "root" environment variable JAVA_HOME. This makes it easy to update your environment variables when updating the JDK. Just point JAVA_HOME to the fresh installation. There is a blogpost explaining the rationale behind all these environment variables.

  3. Is it possible to set an environment variable at runtime from Java?

    Is it possible to set an environment variable at runtime from a Java application? In Java 1.5 java.lang.System class there is the getenv () method, I would only need a setenv () method... Is it possible to modify the environment variables in the java process itself; not in the child process. Is it possible to achieve it through JNI?

  4. Setting JAVA_HOME - Stack Overflow

    Set the JAVA_HOME Variable Windows 7 – Right click My Computer and select Properties > Advanced Windows 8 – Go to Control Panel > System > Advanced System Settings Windows 10 – Search for Environment Variables then select Edit the system environment variables Click the Environment Variables button. Under System Variables, click New.

  5. java - How to set environment variables in JUnit 5 for test case ...

    Jul 4, 2019 · I am working with JUnit 5. My Java code uses the System.getenv("demoVar") to access environment variables. How do I set up this environment variable in a JUnit 5 test class so that my code can access its value during the test?

  6. How to set Java environment path in Ubuntu - Stack Overflow

    Mar 8, 2012 · I just installed JDK in Ubuntu with sudo apt-get install openjdk-6-jdk command, after the installation where's the Java bin directory located? And how can I set the environment path for that direct...

  7. Setting the default Java character encoding - Stack Overflow

    By setting the (Windows) environment variable JAVA_TOOL_OPTIONS to -Dfile.encoding=UTF8, the (Java) System property will be set automatically every time a JVM is started.

  8. java - What is a classpath and how do I set it? - Stack Overflow

    Mar 7, 2010 · On Windows the separator is the semicolon (;) So what's the best way to do it? Setting stuff globally via environment variables is bad, generally for the same kinds of reasons that global variables are bad. You change the CLASSPATH environment variable so one program works, and you end up breaking another program. The -cp is the way to go.

  9. Java system properties and environment variables

    Aug 14, 2011 · What's the difference between system properties System.getProperties() and environment variables System.getenv() in a JVM?

  10. How to set JAVA_HOME in Linux for all users - Stack Overflow

    While we are up to setting JAVA_HOME, let me share some benefits of setting JAVA_HOME or any other environment variable: 1) It's easy to upgrade JDK without affecting your application startup and config file which points to JAVA_HOME. you just need to download new version and make sure your JAVA_HOME points to new version of Java.

Refresh