简体   繁体   English

使用 Gradle 捆绑 java/处理应用程序

[英]Bundle a java/processing application using Gradle

I'm currently using gradle and the processing library to make some simple 2D graphics for a java project.我目前正在使用 gradle 和处理库为 java 项目制作一些简单的 2D 图形。

I want to be able to distribute the project when I'm done, and I have been trying to use "gradle distZip" to do this.我希望能够在完成后分发项目,并且我一直在尝试使用“gradle distZip”来执行此操作。 This creates a zip file, which when unzipped contains a.bat file.这将创建一个 zip 文件,该文件在解压缩时包含一个 .bat 文件。 However, when I run this script, nothing happens.但是,当我运行此脚本时,什么也没有发生。

I have also tried making a.jar file and using "java -jar FILENAME.jar" however, this results in the error我也尝试过制作一个.jar 文件并使用“java -jar FILENAME.jar”但是,这会导致错误

Error: Could not find or load main class App错误:无法找到或加载主 class 应用程序

Is there something I need to add to my build.gradle file to be able to run a file that uses processing or is there some other way I can bundle my project?我需要在我的 build.gradle 文件中添加什么内容才能运行使用处理的文件,还是有其他方法可以捆绑我的项目? Any help is greatly appreciated!任何帮助是极大的赞赏!

I figured out what I was doing wrong.我弄清楚我做错了什么。 When I extracted the zip file, I needed to move it to a separate location, extracting it in the same directory doesn't work.当我提取 zip 文件时,我需要将它移动到一个单独的位置,在同一目录中提取它不起作用。 Once I moved it to my desktop, everything worked fine.将其移至桌面后,一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM