DEV Community

Query Filter
Query Filter

Posted on

bridge17

// --- HEADER FIXES ---
def jh = System.getenv('JAVA_HOME')
if (!jh) {
    throw new GradleException("JAVA_HOME environment variable not set.")
}

// Ensure the application plugin is available for Shadow's internal checks
if (!project.plugins.hasPlugin('application')) {
    apply plugin: 'application'
}

application {
    mainClass.set("comet.agent.UniversalAttacher")
}

// Corrected syntax for extra properties (use = not :)
project.ext.mainClassName = "comet.agent.UniversalAttacher"

// Fix for line 204: Define toolsJarFile specifically for Java 8
def toolsJarFile = []
if (JavaVersion.current().isJava8()) {
    def toolsJar = file("${jh}/lib/tools.jar")
    if (!toolsJar.exists()) {
        // Try JRE subfolder fallback
        toolsJar = file("${jh}/../lib/tools.jar")
    }
    if (toolsJar.exists()) toolsJarFile = toolsJar
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)