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

Eleni Konstantinidou
Eleni Konstantinidou
455 Points

compiling issues

just started courses in java but when i tried to compile my first program an error occurred: Picked up JAVA_TOOL_OPTIONS: -Xmx128m
Picked up _JAVA_OPTIONS: -Xmx128m
i searched my computer for a _JAVA_OPTIONS file but it does not exist. What is the problem and how do i fix it?

5 Answers

OK - to compile you want to use the Java compiler. That is called javac with a c. If you compile and run like this, it'll work:

javac Introductions.java && java Introductions

Make sure you are using the same capitalisation. I put Introductions but you might need to use introductions`.

I hope that helps,

Steve.

P.S. Sorry for the slow reply; I was out - back home now!

Hi there,

That's not an error - just ignore it. Your program will run with that message at the beginning.

Did you get no output from your code?

Steve.

Eleni Konstantinidou
Eleni Konstantinidou
455 Points

i ignored the message and tried to run it anyway but i did not get an output from the code

OK, can you post your code. Just paste it into here. And what did you type in your console to compile and run your code?

Steve.

Eleni Konstantinidou
Eleni Konstantinidou
455 Points
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 java");

  }
}

i typed : java Introductions.java to compile and java Introductions to run

Yes. To compile, use the Java compiler. That's called javac not java, The answers above refer.

Let me know how you get on.

Steve.

Eleni Konstantinidou
Eleni Konstantinidou
455 Points

Thank you very much! It compiles now :)

Excellent! So pleased you got it working. :+1:

Enjoy the rest of the course. Any problems, give me a shout in the Community pages. You can mention me with an @ symbol, just like Twitter and it'll let me know you need some help.

Steve.

Hi, I'm having the similar issue.

Code:

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 something");    
    }
}

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

Getting no output...

Steve Hunter Do you think you can help out with this?

Solution is to (Top Left select File > Save) the file. Then proceed to run Java compiler and then the code again.

Oh yes. Make sure you save your changes before compiling!

It's past midnight here so time for sleep!

Goodnight all!

You haven't run your code; you have just compiled it. You compile with:

javac Introductions.java

You run with:

java Introductions

You can do both at once with:

javac Introductions.java && java Introductions

Good luck!

Steve.