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 Getting Started with Java Introduction to Your Tools

Introductions.java Doesn't work

import java.io.Console;

public class Introductions {

public static void main(String[] args) {
    Console console = System.console();
    // Welcome to the Introductions program!  Your code goes below here
    console.printf("Hello, my name is Jeremy");

} }

treehouse:~/workspace$ javac Introductions.java Picked up JAVA_TOOL_OPTIONS: -Xmx128m Picked up _JAVA_OPTIONS: -Xmxx128m treehouse:~/workspace$ ls Introductions.class Introductions.java treehouse:~/workspace$ java Introductions Picked up JAVA_TOOL_OPTIONS: -Xmx128m Picked up _JAVA_OPTIONS: -Xmxx128m treehouse:~/workspace$

3 Answers

Thank you for that. I see I did miss the error message. Now the only problem is, the code doesn't run. I noticed lots of people mentioning that as well.

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

Well, I was not lazy and made a video, how I just copy paste your code in Workspace started from video, compiled and run your class. It works perfectly fine, take a look:

https://www.youtube.com/watch?v=hUoiV--5WNU

It prints "My name is Jeremy" just fine...

Everytime I try to run java Introductions, I get the picked up statements, then it returns me to the command prompt without printing "Hello, my name is Craig"). I just started over again and same thing.

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

Post your Introductions.java file.

Like I showed you if it does look like the one posted above by you it should print "Hello, my name is jeremy".

Exactly that I showed you in the video ...

Apparently you have to make video of what you do, or at least make a screenshot with workspace showing your Introductions.java and result of java Introductions command.

Without screenshot or video, I cannot help.

I see that you posted in your question, I believe you, but may be a screenshot or video can show me more...

In the worst case scenario, you can always try to run things locally,

Depending on OS you can install Java and then open Terminal and write commands there ...

I think the answer was that I didn't save it before compiling it. I went on to the next lessons about strings and variables and he adds another console.printf command. \n commands didn't take until I save it and recompiled it.

Alexander Nikiforov
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alexander Nikiforov
Java Web Development Techdegree Graduate 22,175 Points

Great, that you've figured that out.

Yeah, saving is important, I also forget from time to time.

It will come with practice. I also suggest you take nice course about workspaces here at treehouse.

May be it can help you:

https://teamtreehouse.com/library/using-treehouse-workspaces