Class couldn't have been found
I'm trying to compile a plugin but somehow it says the following:
Error: The main class ToDoList was not found or loaded
Caused by: java.lang.ClassNotFoundException: ToDoList
I could compile plugins before but now i cannot do it anymore with any plugin. I've been researching and trying possible ways to fix it but i can't manage to do it.
This is the part of the code:
Thanks in advance.71 Replies
ā
This post has been reserved for your question.
Hey @InFiNiTy! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose Post
button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
How do you compile your code? Are you in the correct directory? Is the classpath set up correctly?
To compile it i press the f5 key
How can i check the classpath?
If it's the bin folder, yeah i think so
Pressing F5 should show the executed command in the console. Can you copy this here?
& 'C:\Program Files\Eclipse Adoptium\jdk-17.0.15.6-hotspot\bin\java.exe' '-agentlib:jdwp=transport=dt_socket,server=n,suspend=y,address=localhost:51486' '-XX:+ShowCodeDetailsInExceptionMessages' '-cp' 'C:\Users\AppData\Roaming\Code\User\workspaceStorage\d646ddf4c7bc51033a126ed95050159c\redhat.java\jdt_ws\jdt.ls-java-project\bin' 'ToDoList'
Error: The main class ToDoList was not found or loaded
Caused by: java.lang.ClassNotFoundException: ToDoList
@Madjosz
can you send a screenshot where this class is
which directory
ToDoList?
@ayylmao123xdd this?

This is where the project is located
i meant the folder
like
src
target
etc
src?
yes
do you have a folder named
i dont get you
src
i dont know tbh lol
lemme have a look
you should have folders like
src
main
java
yeah i got a java folder
can you screenshot it
and the folders next to it

this is jre

which ide are you using
this is the latest jre

whats ide?
sorry im kinda new into this
the program where you open the file
eclipse intellij notepad++
vs code
@dan1st | Daniel you are absolutely needed
š
class not found exception
can you send a screenshot of the project opened in vs code

and the files
they should be on the left of your screen
which files?
in vs code
file structure
something like this
hmm
xyz
abc
def
i see nothing
is it at run and debug section?

click this button
No it's what shows you the directories and files
theres nothing

oh
you dont have a project open
open the folder first
thats why
actually no
"Create Java Project"
what project type?
it was working before although i didnt have any project opened
What options are there?


Do you want to use any libraries?
well not for now as im currently a beginner
so i dont know about them yet
Then "No build tools" is fine
then?
i choose the Java folder? @dan1st | Daniel
What exactly does it show?
The folder where i got my projects
so open the folder where you want to make the file or create a new folder and select it
why a new window is now opened

do i close it and keep with the old one or ?
the new one is where your project is now
Check the src folder
that's where you put your classes
App.java
that one?
yes
Can i change its name?
Nice it's now working
if you also change the name of the class inside
the file name must match the class name
yeah i noticed that
btw @dan1st | Daniel can i ask you for tips as a newbie?
yeah i alr asked hahaha
lol
oh you mean general tips?
yeah
I guess make sure you understand all code you are writing
maybe not at the very beginning but pretty soon
i currently want to start doing projects so i can learn better and faster
i asked AI to give me projects ideas
ok
So much thanks for your help guys
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Post Closed
This post has been closed by <@1068550168225529958>.