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 trialAmir Tamim
8,597 PointsConsole Not Running the program
I was wondering why the console will not run my code when I type in : clear && javac Example.java && java Example So far, nothing I have written can be displayed in the console, only the Tools_Options shenanigan
Jennifer Nordell
Treehouse TeacherThis will be much easier for us to help you troubleshoot if we can see your code. The easiest way to get your code to us is to post a link to a "snapshot" of your workspace. On the upper right hand side of your workspace you will find a camera icon. Clicking that will create a "snapshot" which you can link here. We can then make a copy of the workspace and take a look at what might be going on.
Amir Tamim
8,597 PointsThis is the code
public class Example {
public static void main(String[] args) {
// Your amazing code goes here...
System.out.println("We are making a new PEZ Dispenser.");
PezDispenser dispenser= new PezDispenser();
dispenser.characterName="Darth Vader";
System.out.printf("The dispenser is %s %n",
dispenser.characterName);
}
}
Moderator edited: Added markdown so the code renders properly in the forums.
2 Answers
Matt Heffley
908 PointsI was stuck on this for around 30 mins till I realized I never saved the code. Try saving it then rerunning the code in the console and checking to see if that helps =)
Jonathan Grieve
Treehouse Moderator 91,253 PointsOkay it looks like you might need to pass in a String to the console to feed in the character name. Try this
clear && javac Example.java && java Example Amir
And see if it returns the sentence.
Amir Tamim
8,597 PointsIt will not run it. Only says
JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Jonathan Grieve
Treehouse Moderator 91,253 PointsSorry, try again, I edited my post :)
Amir Tamim
8,597 PointsIt worked! Thanks so much!
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsHi Amir,
Could you post your code to the forum for us? There's likely some errors in the code we'll have to debug before your program runs :)