mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[ANY] Setup "jar filename" - specify for what (#385)
This commit is contained in:
parent
ac64ec5483
commit
a71b62ca1a
1 changed files with 2 additions and 2 deletions
|
@ -25,14 +25,14 @@ public ServerWrapperSetup() throws IOException {
|
||||||
public void run() throws IOException {
|
public void run() throws IOException {
|
||||||
ServerWrapper wrapper = ServerWrapper.wrapper;
|
ServerWrapper wrapper = ServerWrapper.wrapper;
|
||||||
ServerWrapper.modulesManager.invokeEvent(new ServerWrapperPreSetupEvent(this));
|
ServerWrapper.modulesManager.invokeEvent(new ServerWrapperPreSetupEvent(this));
|
||||||
System.out.println("Print jar filename:");
|
System.out.println("Print server jar filename:");
|
||||||
String jarName = commands.commandHandler.readLine();
|
String jarName = commands.commandHandler.readLine();
|
||||||
Path jarPath = Paths.get(jarName);
|
Path jarPath = Paths.get(jarName);
|
||||||
String mainClassName;
|
String mainClassName;
|
||||||
try (JarFile file = new JarFile(jarPath.toFile())) {
|
try (JarFile file = new JarFile(jarPath.toFile())) {
|
||||||
URL jarURL = jarPath.toUri().toURL();
|
URL jarURL = jarPath.toUri().toURL();
|
||||||
urlClassLoader = new PublicURLClassLoader(new URL[]{jarURL});
|
urlClassLoader = new PublicURLClassLoader(new URL[]{jarURL});
|
||||||
LogHelper.info("Check jar MainClass");
|
LogHelper.info("Check server jar MainClass");
|
||||||
mainClassName = file.getManifest().getMainAttributes().getValue("Main-Class");
|
mainClassName = file.getManifest().getMainAttributes().getValue("Main-Class");
|
||||||
if (mainClassName == null) {
|
if (mainClassName == null) {
|
||||||
LogHelper.error("Main-Class not found in MANIFEST");
|
LogHelper.error("Main-Class not found in MANIFEST");
|
||||||
|
|
Loading…
Reference in a new issue