Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java Local Development Environments Exploring Your IDE Clean up this mess

Enyang Mercy
PLUS
Enyang Mercy
Courses Plus Student 2,339 Points

Local Devt Enviroment Messy Code

Help !!! i have been stuck for days now. Task 1~4 run properly except 5 Error:./Messy.java:1: error: cannot find symbol import java.util; ^ symbol: class util location: package java ./Messy.java:13: error: cannot find symbol List numberWords = Arrays.asList("six", "seven", "eight", "nine"); ^ symbol: class List location: class Messy 2 errors

Messy.java
import java.util.*;
import java.util.Arrays;

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) {
            System.out.println(numberWord);
            // Use the sout shortcut to write out numberWord;
        }
    }
}
results.txt
"C:\Program Files\Java\jdk1.8.0_161\bin\java" "-javaagent:C:\Windows\IntelliJ IDEA Community Edition 2017.3.5\lib\idea_rt.jar=55080:C:\Windows\IntelliJ IDEA Community Edition 2017.3.5\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_161\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\rt.jar;C:\Users\USER\IdeaProjects\Messy\out\production\Messy" Messy
one
two
three
four
five
six
seven
eight
nine

Process finished with exit code 0

3 Answers

Hi there,

I think it wants you to import the List class specifically, so change * to List.

I hope that helps,

Steve.

:+1: :+1: :+1: :+1:

Wajid Mohammed
Wajid Mohammed
5,698 Points

Hi Enyang, I have a similar problem with the same Exercise and I am not able to go beyond the step of this Messy java code challenge. The task 1 says to copy the code to a new project Messy file in IDE and so I did that copying the code from challenge and then the task says to "Check Work" .. Now where do we check this work. I can see the wrong bits in the code but it wont let me go ahead to fix it and complete challenge. Can you please help? Thanks.