Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Local Development Environments Exploring Your IDE Clean up this mess

Luis Garcia
Luis Garcia
1,552 Points

Clean up this mess

Hey there,

On the "Clean up this mess" challenge I'm copying and pasting this code (which compiles and runs correcty)

import java.util.*;

public class Messy {
    public static void main(String[] args) {
        System.out.println("one");
        System.out.println("two");
        System.out.println("three");
        System.out.println("four");
        System.out.println("five");
        /*Please comment out this line and
        this line as well with a hotkey that does multi - line commenting*/
        List<String> numberWords = Arrays.asList("six", "seven", "eight", "nine");
        for (String numberWord : numberWords) {
            // Use the sout shortcut to write out numberWord;
            System.out.println(numberWord);
        }
    }
}

But I keep getting this error.

./Messy.java:8: error: ';' expected Please comment out this line and

I've tried doing single line comment, removing the whole lines and nothing seems to work and can't make any progress. Any tips?

Cheers, Luis

Grigorij Schleifer
Grigorij Schleifer
10,365 Points

Hi Luis,

I have tried your code and it runs perfect in IntellyJ. Only thing I had to change were the imports ...

The compiler was complaining about this line:

import java.util.*;

So I changed it to:

import java.util.Arrays;
import java.util.List;

Using the alt enter command (Mac)

Luis Garcia
Luis Garcia
1,552 Points

Hi Gregorij,

Thanks for your reply. I just tried that and keep getting the same error.

Cheers, Luis

3 Answers

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Away from my computer now, but try giving space between the star and your comments on both sides. Never seen that before...but might work.

Luis Garcia
Luis Garcia
1,552 Points

Thanks Craig. It didn't make any difference. Probably this is silly, but I just can't use the multi-line comment key shortcut because my keyboard is Spanish configured. Do you think the drill can tell from that?

Cheers, Luis

Will they allow you to use // to comment out each line individually?

Luis Garcia
Luis Garcia
1,552 Points

Hi Robert,

Thanks for your reply. Unfortunately not. I've even introduced some other obvious syntax errors and still stuck on the same one. I wonder if there could be any bug on the Challenge app.

Cheers, Luis

Alexandru Dinu
Alexandru Dinu
13,633 Points

Hello, You paste the code in code tab and results in the results tab?