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

Cannot access Messay error

Greetings, Im doing the java local-development envrionment lab and running into what should be a seemingly easy challenge: Cut and paste the code from my ide into the compiler and generate the results.

I am getting the following error:

JavaTester.java:104: error: cannot access Messy This is my code

package com.teamtreehouse;

import java.util.Set;
import java.util.TreeSet;

public class Main {

    public static void main(String[] args) {
        System.out.printf("This is the classpath:  %s %n",
                System.getProperty("java.class.path"));
        Set<String> propNames = new TreeSet<String>(System.getProperties().stringPropertyNames());
        for (String propertyName : propNames) {
            System.out.printf("%s is %s %n",
                    propertyName,
                    System.getProperty(propertyName));
        }

    }
}

and this is the link to the challenge.
https://teamtreehouse.com/library/local-development-environments/exploring-your-ide/clean-up-this-mess

Can somebody help clean this up for me?

Thanks Chris

Messy.java
package com.treehouse;

import java.util.*;
public class Messy {
    public static void main(String[] args) {
        System.out.println("five");
        System.out.println("one");
        System.out.println("six");
        System.out.println("four");
        System.out.println("two");
        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);
        }
    }
}
results.txt

1 Answer

Jordan Powell
PLUS
Jordan Powell
Courses Plus Student 5,410 Points

To clean up the messy. Java just change the strings in the println messages to correspond with the correct order. One,two, three, etc.