I wanted to use this for some program I hadn’t control for running that Java app so ended with this _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true
environment variable. (read about _JAVA_OPTIONS here)
If you are using Windows, just run this command on Windows cmd:
setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true
Thanks to Jason Nichols for reminding this JVM argument 🙂
Related Contents:
- How to get VM arguments from inside of Java application?
- Difference between _JAVA_OPTIONS, JAVA_TOOL_OPTIONS and JAVA_OPTS
- Java stack overflow error – how to increase the stack size in Eclipse?
- What does JVM flag CMSClassUnloadingEnabled actually do?
- Increasing the JVM maximum heap size for memory intensive applications
- Debug a java application without starting the JVM with debug arguments
- What does -XX:MaxPermSize do?
- “Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G
- What is the largest possible heap size with a 64-bit JVM?
- Java heap Xms and linux free memory different
- Java Exceptions counter on JVM HotSpot
- Duplicated Java runtime options : what is the order of preference?
- How do I write a correct micro-benchmark in Java?
- How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version
- How do I set the proxy to be used by the JVM
- How can I increase the JVM memory? [duplicate]
- What is the exact meaning of static fields in Java?
- Android Studio Gradle project “Unable to start the daemon process /initialization of VM”
- Does the JVM prevent tail call optimizations?
- Java heap terminology: young, old and permanent generations?
- Getting Java version at runtime
- What is the default encoding of the JVM?
- Override Java System.currentTimeMillis for testing time sensitive code
- Possible causes of Java VM EXCEPTION_ACCESS_VIOLATION?
- Can the JVM recover from an OutOfMemoryError without a restart
- No-throw VirtualMachineError guarantees
- Setting JVM heap size at runtime
- How to find the JVM version from a program?
- When is the static block of a class executed?
- Differences between “java -cp” and “java -jar”?
- Android Studio – No JVM Installation found
- How do I find out what keystore my JVM is using?
- Error launching Android Studio: Failed to create JVM: error code-6
- Java – how to load different versions of the same class?
- Interpreting jemaloc data possible off-heap leak
- String s = new String(“xyz”). How many objects has been made after this line of code execute?
- Java user.home is being set to %userprofile% and not being resolved
- out in System.out.println()
- How do you crash a JVM?
- Is JVM open source code?
- Memory effects of synchronization in Java
- How to calculate HashMap memory usage in Java?
- How to set timezone to UTC in Apache Spark?
- Bytecode features not available in the Java language
- Java verbose class loading
- What are bytecodes and how does the JVM handle them
- Why a sawtooth shaped graph?
- Java Memory explained (SUN JVM)
- What does the UseCompressedOops JVM flag do and when should I use it?
- Is it bad practice to use break to exit a loop in Java? [closed]