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 Strings and Variables

About the Launch Workspace

Truly, I want to be able to utilize the console via the Launch Workspace as I move along in the course. However, the same error messages continue to display- despite correct code:

(code) import java.io.console; public class Introductions{ public static void main(String[] args) { Console.printf("Hello World"); } }

(console)
treehouse:~/workspace$ java Introductions.java
Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
Error: Could not find or load main class Introductions.java

carlsow
carlsow
515 Points

I keep running into the same issue. I tried running "clear && javac Introductions.java && java Introductions" and did not have any luck. Has anyone come up with a solution to the "JAVA_TOOL_OPTIONS: -Xmx128m" and "_JAVA_OPTIONS: -Xmx128m" errors?

Here's the code I'm trying to run. https://w.trhou.se/tpynvawqex

1 Answer

Matthias Margot
Matthias Margot
7,236 Points

To run a code in the console you have to give the command 'java' (like you did) with only the class name like so:

java Introductions

However this won't work if you haven't first compiled your code into a class file like so:

javac Introductions.java

You will have to compile your code everytime you make changes to it for your program to run with those changes so the best way to do this is to just write those two comments together with the optional 'clear' to clear your console display of any previous activity like so:

clear && javac Introductions.java && java Introductions

Hope i could help,

Matthias

This clear && javac Introductions.java && java Introductions does not work. It does not clear anything What can I do to fix this issue?