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 Local Development Environments How it Works T.M.A. - Too Many Acronyms

java command

To run a java program we type "java MainClassName" in terminal window. What is happening behind the scenes when we type this command. Are running our program with JRE when we type this command?

There is a java in the JDK graphics craig showed and it is out of JRE is that the same java we used to run our code. if yes why it is out of JRE while JRE is important to run java code?

Please explain!

2 Answers

Kristian Gausel
Kristian Gausel
14,661 Points

So typing "java ClassName" is how you run any java program, which is ran with the JRE (Java Runtime Environment). You need the JDK (Java Development Kit) to compile the java files to java bytecode (which is done with javac, which is the java compiler)

The "There is a java" part I do not really understand. what do you mean by "a java"?

Kristian Gausel


there is a java in the graphical display of the java platform which is outside the JRE.