How to get the current running Java processes with full argument
Answer:
To do so, use the command:
#jps -mlvV
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
How to get the current running Java processes with full argument
Answer:
To do so, use the command:
#jps -mlvV
How to change keystore password using keytool?
Answer:
# keytool -storepasswd -keystore keystore-file
How to find a class in a Jar file
Answer:
To find a class file in a given Java Jar file, e.g. to find the class "KeyToken" in the file "selenium-server-standalone.jar",
# jar -tf selenium-server-standalone.jar | grep KeyToken
org/yaml/snakeyaml/tokens/KeyToken.class
How to disable IPv6 support in a Java program
Answer:
To completely turn off IPv6 support in Java, you can set the system property "java.net.preferIPv4Stack", e.g.
# java -Djava.net.preferIPv4Stack=true ...
How to get the hostname of a local machine using Java
Answer:
The following codes illtsraeted how to get the hostname of the local machine using Java.
import java.net.InetAddress;
public class Test {
public static void main(String[] args) {
try {
InetAddress addr = InetAddress.getLocalHost();
// Get hostname
String hostName = addr.getHostName();
System.out.println(hostName);
} catch (Exception e) {}
}
}