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

I keep getting the error Picked up JAVA_TOOL_OPTIONS: -Xmx128m and the code wont compile

I've found a couple other threads on the forum which weren't really helpful at all. I can't compile or run any programs and I'm sure I'm typing everything in correctly. I don't know what to do at this point. I'm running Windows 10 64 bit.

Mihai Craciun
Mihai Craciun
13,520 Points

post your code here. Maybe I could help. the 'Picked up JAVA_TOOL_OPTIONS: -Xmx128m' is not an error you will get that everytime whatever your code runs or not

2 Answers

Mihai Craciun
Mihai Craciun
13,520 Points

the printf() method expects 2 or more arguments: a format and the rest of arguments. To print what you wanted there you should use the simple print() method like this:

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.print("Hello, my name is Geoffrey");

} }

The printf method work something like this:

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
     String myName = "Geoffrey";
    console.printf("Hello, my name is %s", myName);

} }

if you copy any of this it should run. Please let me know if there are any other problems.

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 Geoffrey");

} }

Any ideas?