Something weird is happening with my Eclipse IDE

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:
30 Replies
JavaBot
JavaBot6mo ago
This post has been reserved for your question.
Hey @Apro87 ▄︻デ══━一 — |pew> |pew>! 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.
ayylmao123xdd
ayylmao123xdd6mo ago
interesting what do you use gradle or maven or none of the above
Ⱥᵽɍø8̯̭̓̇͂7ͮ ▄︻デ══━一 —
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
ayylmao123xdd
ayylmao123xdd6mo ago
ok so click project clean clean projects or an option like that
ayylmao123xdd
ayylmao123xdd6mo ago
and then just click ok or whatever
ayylmao123xdd
ayylmao123xdd6mo ago
oh right click the start a build option too should be there
Ⱥᵽɍø8̯̭̓̇͂7ͮ ▄︻デ══━一 —
this is what I should be seeing right?
No description
ayylmao123xdd
ayylmao123xdd6mo ago
yea click clean
Ⱥᵽɍø8̯̭̓̇͂7ͮ ▄︻デ══━一 —
ive done it twice, nothing seems to have changed stilll getting that stupid error
ayylmao123xdd
ayylmao123xdd6mo ago
can you send a screenshot of your file structure the files on the left
Ⱥᵽɍø8̯̭̓̇͂7ͮ ▄︻デ══━一 —
when I have an error, I dont normally have a red X on those icons this is the first time i've seen these
ayylmao123xdd
ayylmao123xdd6mo ago
send the game.java file
Dexter
Dexter6mo ago
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;
}
}
}


}
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.
Ⱥᵽɍø8̯̭̓̇͂7ͮ ▄︻デ══━一 —
nope, i got it to work right?? what happened there?
ayylmao123xdd
ayylmao123xdd6mo ago
so does it work now
Ⱥᵽɍø8̯̭̓̇͂7ͮ ▄︻デ══━一 —
for some reason I just copied the whole file, deleted it, and pasted it back in and for some reason it worked
ayylmao123xdd
ayylmao123xdd6mo ago
oh then the compilation went crazy
Ⱥᵽɍø8̯̭̓̇͂7ͮ ▄︻デ══━一 —
ah, so an issue on eclipse's side well thank you so much for helping me!!
JavaBot
JavaBot6mo ago
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.
ayylmao123xdd
ayylmao123xdd6mo ago
eclipse shenanigans lmao
ayylmao123xdd
ayylmao123xdd6mo ago
well i didnt do much but ur welcome
Ⱥᵽɍø8̯̭̓̇͂7ͮ ▄︻デ══━一 —
yea but thank you for your time bye!
JavaBot
JavaBot6mo ago
Post Closed
This post has been closed by <@1125106121779187785>.

Did you find this page helpful?