Error when trying to open java files or something???? PLEASE help me

Sinatra

Distinguished
Oct 4, 2015
101
1
18,685
I have no idea where to place this issue other than here, you guys are usually GREAT with answering my questions so, here we go.

EVERYTIME i attempt to open a java file it opens a cmd application for like a milisecond and closes, after spamming the file and attempting to read the text on the cmd it says something along the lines of:
"could not find or load main class" followed by the directory path
example: could not find or load main class C://dfhkjasdn idk
i WOULD attempt to screenshot it or something but i can't even open the fucking file with java anymore.
(I'm talking about plugins btw)
i'm trying to install Optifine and all of this shit happens... like wtf is going on?

Thanks in advance. <3