Not sure how to fix this

Hi I’m transferred my Processing code into Eclipse to run it and I keep getting this error, I’m not sure what it means or how to fix it. I tried seeing if similar people were getting this error on Github but was not able to find the same exact error that I have. The problem that I’m having it the animation is running but I just get a grey screen and nothing shows up. I downloaded the core jar file and minim as well since I have it in my animation. I tried everything by changing code around and adding the public void setup() { that it told me to add but I still can’t get it to run. I also tried adding a print statement to see if that would work which it does but my animation still does not show up and I get a grey screen when running it. I am using Processing 3.If anyone has suggestions on how to fix this please let me know.1

1 Like

Could you post your code that might make it more clear? Are you using any processing libraries? What JDK are you using?

Sometimes when using libraries they don’t import easily. It looks like your minim library is looking for a class called JSMinim. Either the library is missing a dependency or it’s built in a modular way and it’s missing a part that is separate from the core. You can see how multiple jar files are included in the library. I’ve had this problem a couple times. My solution is to just add all the jars to the build path. Someone might know a more elegant solution for this problem. If I was to guess it’s a class in the jsminim.jar because that’s the name of the class that’s causing the error.
minim

You mean all of the jar files that show up when you select the processing library folder to import?

No it’s the ones in the minim library itself. I found a zip file here. When you unzip it they’re under the library directory.

This would be the correct one right? Isnt it supposed to say minim.jar?
1

This is the jar file that I have downloaded now and this is the error I get now still cant run this.
1 2

It looks like you’re in the source folder try the following

Import > File System > Browse > locate the minim unzipped file > library > Select Folder. Should see something like the image below. Add everything except for export.txt.

Then they should show up in your project and add them to the build path.

minim2

Changed it to this, it doesnt run still
1

Also I am still getting the same thing with the error:

Error: Could not find or load main class Sketch
Caused by: java.lang.ClassNotFoundException: Sketch

Is your sketch in the default package?

I have Sketch and star in the default package along with the songs. Songs should be in the default package correct?
1

Yeah it’s just you have to use a different main method if they’re in a different package but that doesn’t apply here. I’m not sure what’s going wrong. I would suggest starting a fresh project and add things in one at a time. Might be tedious but it should become very clear what the section of code the problem is in. Sorry I haven’t been more helpful.

I redid this many times but I’m still getting the same error. I’m not sure what you mean by different main method. What should it be instead?

Say your Sketch class is in a package like com.example then you would use.

PApplet.main("com.example.Sketch");

I thought this might be the problem because it seems like your project is having problems finding files.

Which line do I put that code on? And what do I replace the com.example with? Or do I just put it exactly like how you have it.

What do I replace the come.example with? I’m guessing I need to replace that since you probably used that as an example. Also I get this when clicking on the error, what would you recommend changing when this pops up? I don’t use eclipse much so I don’t want to do anything that would change anything

Here’s my setup for a hello world.helloworld

Does that run for you when you try anything using minim?

Got the PlayAFile example working. I ended up importing all the jars from processing and minim. Can post the code if you want but it’s exactly what’s on github except for moving the size() from setup() to settings(). Also not seen in the screen shot the groove.mp3 file is in the data directory directly under the project directory.

1 Like