mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] Print java version in version
command
This commit is contained in:
parent
f188378fd6
commit
ea7159dba6
2 changed files with 11 additions and 2 deletions
|
@ -1,11 +1,17 @@
|
|||
package pro.gravit.launchserver.command.basic;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import pro.gravit.launchserver.LaunchServer;
|
||||
import pro.gravit.launchserver.command.Command;
|
||||
import pro.gravit.utils.Version;
|
||||
import pro.gravit.utils.helper.JVMHelper;
|
||||
import pro.gravit.utils.helper.LogHelper;
|
||||
|
||||
import java.lang.management.RuntimeMXBean;
|
||||
|
||||
public final class VersionCommand extends Command {
|
||||
private transient final Logger logger = LogManager.getLogger();
|
||||
public VersionCommand(LaunchServer server) {
|
||||
super(server);
|
||||
}
|
||||
|
@ -22,6 +28,9 @@ public String getUsageDescription() {
|
|||
|
||||
@Override
|
||||
public void invoke(String... args) {
|
||||
LogHelper.subInfo("LaunchServer version: %d.%d.%d (build #%d)", Version.MAJOR, Version.MINOR, Version.PATCH, Version.BUILD);
|
||||
logger.info("LaunchServer version: {}.{}.{} (build #{})", Version.MAJOR, Version.MINOR, Version.PATCH, Version.BUILD);
|
||||
RuntimeMXBean mxBean = JVMHelper.RUNTIME_MXBEAN;
|
||||
logger.info("Java {}({})", JVMHelper.getVersion(), mxBean.getVmVersion());
|
||||
logger.info("Java Home: {}", System.getProperty("java.home", "UNKNOWN"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
import java.util.Arrays;
|
||||
|
||||
public class ModulesCommand extends Command {
|
||||
private transient Logger logger = LogManager.getLogger();
|
||||
private transient final Logger logger = LogManager.getLogger();
|
||||
public ModulesCommand(LaunchServer server) {
|
||||
super(server);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue