Open Xombie404 opened 3 years ago
Same problem and solution using Visual Studio Code and the Maven packages for LibGDX.
ditto for android studio... just prefixed with package and was fine
@Xombie404 you have saved me today. I was struggling for hours now until I came across this. I'm using IntelliJ, but can I get a little clarification as to why this happens???....
@Jdevsecops0x00 I forget the context for this, just got an email saying people replied to this, I tried looking around for my book and can't find it, I think it had something to do with bluej simplifying something my IDE wasn't simplifying involving packages. Its been so long and to be honest I think I just intuited what is essentially a bandaid on something I don't understand about java. I'm sorry I can't be more helpful, I'll keep looking for the book, but I ultimately settled on using godot later on and have been doing way better learning gamedev so far. Good luck friend
If someone following along with Ch.3 on page 69, isn't using blueJ, they have are highly likely to run into this error, The solution I found was instead of the line:
Class theClass = Class.forName(className);
they should instead use
Class theClass = Class.forName("com.mygdx.game." + className);
I just wanted to make sure any people who struggle with this issue will be able to find a solution quicker than I did.
This worked for me, since I'm using Eclipse