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 Java Basics Using your New Tools Multiple Strings

Anirudh Bathini
Anirudh Bathini
904 Points

When i launch a workspace for this video, doesnt launch the files tree story with it.

When i click on launch workspace, the file just opens up the workspace with a folder Java Basics - Parsing Integers. There is no treestory folder or file in my workspace.

7 Answers

Andrew Winkler
Andrew Winkler
37,739 Points

Huh, maybe try reloading the workspace for the video. When I just tried it, it worked perfectly for me.

if that doesn't work, here's the file structure that loaded for me:

the root folder is: Java Basics – Multiple Strings

a child file of that is: TreeStory.class

another child file is: TreeStory.java

The contents of TreeStory.java look like this:

import java.io.Console;

public class TreeStory {

    public static void main(String[] args) {
        Console console = System.console();
        /*  Some terms:
            noun - Person, place or thing
            verb - An action
            adjective - A description used to modify or describe a noun
            Enter your amazing code here!
        */
      String name = console.readLine("Enter your name: ");
      String adjective = console.readLine("Enter an adjective: ");
      console.printf("%s is very %s", name, adjective);

      String ageAsString = console.readLine("How old are you? ");
      int age = Integer.parseInt(ageAsString);

      if (age < 13) {
        //Insert exit code
        console.printf("Sorry you must be at least 13 to use this program.\n");
        System.exit(0);



      }
    }

}

If reloading the workspace for the video doesn't work, creating, naming these files, and pasting their appropriate contents should suffice. Let me know if you have any difficulties.

As always, if this post helped, be sure to vote it up best answer! Happy coding!

Andrew Winkler
Andrew Winkler
37,739 Points

the root folder is: Java Basics – Multiple Strings

--indent-- a child file of that is: TreeStory.class

--indent-- another child file is: TreeStory.java

Double check that this is your file structure.

Anirudh Bathini
Anirudh Bathini
904 Points

There is no class file, Shouldn't i compile the file to get the class file?

Andrew Winkler
Andrew Winkler
37,739 Points

It exists in the mock up. I say create one. Make sure you are saving before compiling as well.

Anirudh Bathini
Anirudh Bathini
904 Points

I just created a whole new workspace, and it's running now. still no class file, but could you send me the contents of the class file so i could create it? Thanks :)

Andrew Winkler
Andrew Winkler
37,739 Points

if you can, try forking it too.

Anirudh Bathini
Anirudh Bathini
904 Points

Awesome sauce! i realized what i was doing wrong! i had an additional treestory folder which i didn't need!! Thanks for all the help buddy! :)

Anirudh Bathini
Anirudh Bathini
904 Points

Thank you! I was able to create the TreeStory.Java file, but this is the error I get when im trying to compile it!

treehouse:~/workspace$ javac TreeStory.java
javac: file not found: TreeStory.java
Usage: javac <options> <source files>
use -help for a list of possible options
treehouse:~/workspace

Anirudh Bathini
Anirudh Bathini
904 Points

Thank you! I was able to create the TreeStory.Java file, but this is the error I get when im trying to compile it!

treehouse:~/workspace$ javac TreeStory.java
javac: file not found: TreeStory.java
Usage: javac <options> <source files>
use -help for a list of possible options
treehouse:~/workspace

Andrew Winkler
Andrew Winkler
37,739 Points

Awesome saustastic! I can't believe the sharing my workspace worked! I'll use that feature more often now that I know -- especially for long exercises!