DEV Community

Query Filter
Query Filter

Posted on

path8

doFirst {

    def cpFile = new File(buildDir, "real-classpath.txt")
    cpFile.text = classpath.asPath

    systemProperty "quantum.classpath.file", cpFile.absolutePath

    // do NOT pass the classpath string itself
}


import java.io.*;
import java.lang.reflect.Method;
import java.nio.file.Files;

public class DebugLauncher {

    public static void main(String[] args) throws Exception {

        String cpFile = System.getProperty("quantum.classpath.file");

        if (cpFile != null) {
            String realCp = new String(Files.readAllBytes(new File(cpFile).toPath()));
            System.setProperty("java.class.path", realCp);
        }

        Class<?> clazz = Class.forName("com.citigroup.get.quantum.server.Server");
        Method m = clazz.getMethod("main", String[].class);
        m.invoke(null, (Object) args);
    }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)