Your example build.gradle.kts helped me a lot. When you run self-executable jar, java will look for the Main-Class in MANIFEST.MF file located under META-INF folder. gradle clean followed by gradle build results in: Total time: 3.584 secs C:\Code\gradletest>gradle build :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar :assemble :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE :check UP-TO-DATE :build, Total time: 3.869 secs C:\Code\gradletest>, AND the MANIFEST.MF file reads as: Manifest-Version: 1.0 Created-By: 1.8.0-b132 (Oracle Corporation) Main-Class: Code.gradletest.HelloWorld, STILL unable to RUN the application. To get latest had to find SDKMAN! Du kannst also einfach rennen In order to run the main method from our jar, we need to mention it inside the ‘Main-Class’ property of the manifest file (mainClass attribute in POM.xml in case of Mavenized application) which needs to be bundled with the code as well. Problem: no main manifest attribute, in "APPLICATION_NAME.jar" Einschließlich Java-Bibliothek, die mit Gradle erstellt wurde ... Das "maven-publish" -Plugin von Gradle vereinfacht die Veröffentlichung im lokalen Repository und erstellt automatisch eine PublishToMavenLocal-Aufgabe. This MANIFEST.MF file that you’ve created is irrelevant. I would imagine there are ways to amend the manifest with “classpath” properties that add your dependencies. The JAR is not executed, of course, since we haven’t defined the main entry class in in manifest. Thank you for your effort. That should have been java -jar app.jar instead of java -jar "app".. Possible to create JAR artifact by defining Manifest in Gradle? 郑重声明:本站内容来源于网络,为尊重原创,本站尽力寻找并添加资料原文链接。如有侵权,请及时联系邮箱给我发信删除!, "No Main Manifest Attribute" in ----.jar Netbeans, No main manifest attribute, in gdx-setup.jar, "no main manifest attribute" when trying to execute fat jar, no main manifest attribute error for maven project, no main manifest attribute error after add volley.jar library, scala sbt assembly "no main manifest attribute", Java/Swing/Maven: no main manifest attribute, No main manifest attribute after creating jar, Cmd Windows, No main manifest attribute (Heroku deployment), no main manifest attribute, in application.jar, No main manifest attribute error when running jar, Can't execute jar- file: "no main manifest attribute". C:\Code\gradletest\build\libs>jar tf helloworld-0.1.jar META-INF/ META-INF/MANIFEST.MF Code/ Code/gradletest/ Code/gradletest/HelloWorld.class, C:\Code\gradletest\build\libs>jar xf helloworld-0.1.jar shows that the MANIFEST.MF file has only 2 lines (1 blank line) Manifest-Version: 1.0. no main manifest attribute spring maven (2) ... Je suis un peu fou avec cette erreur que je reçois lors de l’exécution d’un fichier JAR créé à partir de Gradle. L'erreur indique "pas d'attribut manifeste principal, dans RxJavaDemo.jar". java - with - kotlin no main manifest attribute . 847 gradle-app.setting 09/09/2014 08:22 AM, 126 HelloWorld.java 09/09/2014 09:19 AM, apply plugin: ‘java’ //apply plugin: ‘eclipse’, mavenCentral() } // end::repositories[], compile “joda-time:joda-time:2.2” } // end::dependencies[], // tag::wrapper[] task wrapper(type: Wrapper) {, gradleVersion = ‘2.1’ } // end::wrapper[], Manifest-Version: 1.0 Created-By: 1.8.0-b132 (Oracle Corporation) Main-Class: Code.gradletest.HelloWorld, C:\Code\gradletest>gradle build :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :jar :assemble :compileTestJava UP-TO-DATE :processTestResources UP-TO-DATE :testClasses UP-TO-DATE :test UP-TO-DATE :check UP-TO-DATE :build, Directory of C:\Code\gradletest\build\libs. The error reads "no main manifest attribute, in RxJavaDemo.jar" I tried manipulating the Manifest property but I think I'm forgetting to add the dependencies or something to it. If you also want the manifest change, then you’ll have to add something like the following to your build.gradle: With this, both “gradle run” and your “java -jar …” approach will execute the main class. The META-INF has been removed. The Java plugin expects Java code in “src/main/java”, and the classes should match the package structure (Code/gradletest/HelloWorld.java). I am a noob. C:\Code\gradletest\build\libs>java -jar helloworld-0.1.jar, no main manifest attribute, in helloworld-0.1.jar. I still get: no main manifest attribute, in helloworld-0.1.jar. I viewed the contents ( jar tf ) however I did not notice this. I looked at your zip, and your main.kt source. However, I have been through the documentation and Gradle produces a jar file, I cannot run the jar file. Bob_Paris (robert.paris) March 30, 2015, 12:53am #1. C:\Code\gradletest\build\libs>java -jar helloworld-0.1.jar no main manifest attribute, in helloworld-0.1.jar. Gradle has changed a bit. Take time to understand ! Manifest 속성을 조작하려고했지만 종속성이나 무언가를 추가하는 것을 잊은 것 같습니다. no main manifest attribute spring maven (2) ... Je suis un peu fou avec cette erreur que je reçois lors de l’exécution d’un fichier JAR créé à partir de Gradle. I have tried to run it with gradle run and with the jar command. L'erreur indique "pas d'attribut manifeste principal, dans RxJavaDemo.jar". Why don’t you show us your current build script, full text of your Java class, full directory structure, and full directory structure of the resulting jar? Used the jar uf to update the jar. OK deleted the whole directory structure and started again. Some lines in directory list removed for clarity purposes. Add back the following statement to the top of your class: And when you’re asked to provide additional information, there’s not much point in creating separate responses for each piece of information.