1

I'm currently using gradle and the processing library to make some simple 2D graphics for a java project.

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. This creates a zip file, which when unzipped contains a .bat file. 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

Error: Could not find or load main class App

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? Any help is greatly appreciated!

alan
  • 11
  • 2
  • double check your class path (e.g. if you run a jar that uses processing and the dependency jars aren't packed into big one, you need to pass `-cp` (or `-classpath`) to tell the runtime where core.jar, etc. live), and also if you're using packages pay attention to fully qualified class names. doing a quick search brings up: https://stackoverflow.com/questions/18093928/what-does-could-not-find-or-load-main-class-mean , https://www.baeldung.com/java-could-not-find-load-main-class HTH – George Profenza Dec 17 '20 at 10:53

1 Answers1

0

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. Once I moved it to my desktop, everything worked fine.

alan
  • 11
  • 2