Java 科特林胶囊梯度误差
尝试使用Gradle创建胶囊时出错Java 科特林胶囊梯度误差,java,gradle,kotlin,quasar,Java,Gradle,Kotlin,Quasar,尝试使用Gradle创建胶囊时出错 Failed to find Premain-Class manifest attribute in E:\Dropbox\Projects\Kotlin\Games\CSGO\Charlatano\build\libs\capsule.jar Error occurred during initialization of VM agent library failed to init: instrument CAPSULE: Client connect
Failed to find Premain-Class manifest attribute in
E:\Dropbox\Projects\Kotlin\Games\CSGO\Charlatano\build\libs\capsule.jar
Error occurred during initialization of VM
agent library failed to init: instrument
CAPSULE: Client connection failed.
CAPSULE EXCEPTION: Accept timed out while processing null null: null (for stack trace, run with -Dcapsule.log=verbose)
Press any key to continue . . .
这是我的build.script
buildscript {
ext.kotlin_version = '1.1-M01'
ext.jna_version = '4.3.0-SNAPSHOT'
ext.quasar_version = '0.7.6'
ext.gdxVersion = '1.9.4'
repositories {
mavenCentral()
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap-1.1' }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
apply plugin: 'java'
apply plugin: 'kotlin'
apply plugin: 'application'
group 'com.charlatano'
version '0.4.3'
mainClassName = 'com.charlatano.Charlatano'
sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap-1.1' }
}
configurations {
quasar
capsule
}
dependencies {
compile group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib', version: kotlin_version
compile group: 'net.java.dev.jna', name: 'jna', version: jna_version
compile group: 'net.java.dev.jna', name: 'jna-platform', version: jna_version
compile group: 'org.jire.arrowhead', name: 'arrowhead', version: '1.2.1'
capsule group: 'co.paralleluniverse', name: 'capsule', version: '1.0.3'
quasar group: 'co.paralleluniverse', name: 'quasar-core', version: quasar_version
compile group: 'co.paralleluniverse', name: 'quasar-core', version: quasar_version
compile group: 'co.paralleluniverse', name: 'quasar-actors', version: quasar_version
compile group: 'co.paralleluniverse', name: 'quasar-kotlin', version: quasar_version
compile "com.badlogicgames.gdx:gdx:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
}
task capsule(type: Jar, dependsOn: jar) {
archiveName = "capsule.jar"
from jar // embed our application jar
from { configurations.runtime } // embed dependencies
from(configurations.capsule.collect { zipTree(it) }) { include 'Capsule.class' } // we just need the single Capsule class
manifest {
attributes(
'Main-Class' : 'Capsule',
'Application-Class' : mainClassName,
'Extract-Capsule' : 'false', // no need to extract the capsule
'Min-Java-Version' : '1.8.0',
'JVM-Args' : run.jvmArgs.join(' '),
'System-Properties' : run.systemProperties.collect { k,v -> "$k=$v" }.join(' '),
'Java-Agents' : configurations.quasar.iterator().next().getName()
)
}
}
run {
jvmArgs "-javaagent:${configurations.quasar.iterator().next()}"
}
下面是它生成的jar文件。
请告诉我怎么了,谢谢 似乎
capsule
中的MANIFEST.md已损坏,它缺少Premain Class
属性,如下所示:
Premain-Class: org.eclipse.package.ObjectSizeFetcher
您的胶囊
清单文件应如下所示:
Manifest-Version: 1.0
Created-By: 1.5.0_18 (Sun Microsystems Inc.)
Premain-Class: org.eclipse.package.ObjectSizeFetcher
检查类似问题以了解更多信息:似乎
胶囊中的MANIFEST.md已损坏,并且缺少Premain类的属性,如下所示:
Premain-Class: org.eclipse.package.ObjectSizeFetcher
您的胶囊
清单文件应如下所示:
Manifest-Version: 1.0
Created-By: 1.5.0_18 (Sun Microsystems Inc.)
Premain-Class: org.eclipse.package.ObjectSizeFetcher
查看类似问题以了解更多信息:Examplebuild.gradle.kts
使用gradle构建.jar
:Examplebuild.gradle.kts
使用gradle构建.jar
: