#Something weird is happening with my Eclipse IDE

1 messages · Page 1 of 1 (latest)

heady flume
#

So this morning, I opened up my computer to continue a project I was working on. Then my project I was working on(the only one in the workspace as this is my first project) was gone. I panicked but then realized I could just re-import it back in. After I got it back in the workspace, my editor looked different. None of the variable names were highlighted in a different color as they normally are. I thought nothing of it, but then, I couldn't open the game while tabbed in the UI class I made. I tabbed into my main Game class, and ran the game, and saw that I had an error

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Syntax error, insert "}" to complete ClassBody

at BackroomsAccurateLore/package1.UI.<init>(UI.java:163)
at BackroomsAccurateLore/package1.Game.<init>(Game.java:9)
at BackroomsAccurateLore/package1.Game.main(Game.java:14)

That shouldn't have happened, as it is saying that there should be a } to close the class body even though there clearly is a } to close it. It is even indented correctly. I will paste my code below:

tulip thistleBOT
#

This post has been reserved for your question.

Hey @heady flume! Please use /close or the Close 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.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

heady flume
past shuttle
#

interesting

#

what do you use

#

gradle or maven

#

or none of the above

heady flume
#

I am very new to this, but how do I check

#

?

#

I think something got changed somehow, my eclipse has never acted like this before

#

its like it's on a whole new platform

past shuttle
#

ok so

#

click

#

project

#

clean

#

clean projects or an option like that

heady flume
#

k

past shuttle
#

and then just click ok or whatever

heady flume
#

alr

past shuttle
#

oh right click the

#

start a build option too

#

should be there

heady flume
#

ok

#

this is what I should be seeing right?

past shuttle
#

yea click clean

heady flume
#

ive done it twice, nothing seems to have changed

#

stilll getting that stupid error

past shuttle
#

can you send a screenshot of your file structure

#

the files on the left

heady flume
#

when I have an error, I dont normally have a red X on those icons

#

this is the first time i've seen these

past shuttle
#

send the game.java file

heady flume
#

k

peak quarryBOT
#

alr i just recopied and pasted in the UI file and now its blue and glowing, im going to see if i still get an error, but heres the game file

package package1;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;


public class Game {
   
   ChoiceHandler cHandler = new ChoiceHandler();
   UI ui = new UI();
   Transitions tr = new Transitions(ui);

   public static void main(String[] args) {
       
       new Game();

   }
   
   public Game() {
       
       ui.createUI(cHandler);
       tr.showTitleScreen();
   }
   
   public class ChoiceHandler implements ActionListener{
       public void actionPerformed(ActionEvent event) {
           
           String yourChoice = event.getActionCommand();
           
           switch(yourChoice) {
           case "Start": tr.titleInvis(); break;
           case "c1": break;
           case "c2": break;
           case "c3": break;
           case "c4": break;
           }
       }
   }
   

} ```

This message has been formatted automatically. You can disable this using /preferences.

heady flume
#

nope, i got it to work right??

#

what happened there?

past shuttle
#

so does it work now

heady flume
#

for some reason I just copied the whole file, deleted it, and pasted it back in and for some reason it worked

past shuttle
#

oh

#

then the compilation went crazy

heady flume
#

ah, so an issue on eclipse's side

#

well thank you so much for helping me!!

tulip thistleBOT
# heady flume well thank you so much for helping me!!

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.

past shuttle
#

eclipse shenanigans

#

lmao

heady flume
past shuttle
#

well i didnt do much

#

but ur welcome

heady flume
#

yea but thank you for your time

#

bye!