How to include com.sun.tools JAR in my class class Gradle JAR design script and also synchronize with my IDE?

I need the com.sun.tools command as a compilation dependency, so I just copied it to the libs folder in my Intellij project. However, I am trying to use gradle. I only need this as a dependency for ONE of my modules. How should I do it. I currently have this in my module jar task:

jar {

    from('build/classes/main/')
    from('libs/tools.jar')

    manifest {
        attributes 'Manifest-Version': '1.0',
                'Class-Path': configurations.runtime.files.collect {"../lib/${it.name}" },
}

I also tried this in my closure of the dependency modules:

 compile fileTree(dir: 'lib', include: '*.jar')

I also just tried to put the jar all my way to the project and am not compiling:

    classpath ":tools"

Perhaps this is correct, but my IDE is not refreshing correctly? I already have a plugin

apply plugin: 'idea'

and it works fine until I try to do it.

EDIT: , jar . , ?

+4
1

tools.jar :

dependencies {
  compile files("${System.getProperty('java.home')}/../lib/tools.jar")
}

Intellij 2017.1 .

JDK, JRE tools.jar.

+2

Source: https://habr.com/ru/post/1673208/


All Articles