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 Using your New Tools Multiple Strings

Offline java editor with console comparable to workspaces?

Hi, I am searching for an offline java editor with console comparable to workspaces. I am having difficulty with workspaces (the code screen focus keeps jumping to the console window), so I was wondering if there is any alternative editor/console available?

Thanks

Ben

moved comment to an answer.

Thanks Derek,

Great, I am still new at this, I was thinking that the console referred to the browser.... Anyhow I will use your suggestion as it seem very straight-forward. Thanks and have a great day

Ben

No problem Ben. I'm glad I could help. If you see this message could you mark my answer as "best answer" to show that this thread has been solved, thanks again.

3 Answers

Yes I am.

Well say you had a java source code file, and it's saved on your desktop in a file called "java practice". In that case, in your command prompt you would need to set the directory path to the "java practice" folder.

(To navigate directories inside of a windows command prompt you would use the "cd" command.)

Example:

C:\Users\Ben\Desktop\java practice>

Once your directory path is set to the specific folder or wherever you saved the java source code file to, then you would just compile and run like normal.

Example output: (Your java source code file is named HelloWorld.java)

C:\Users\Ben\Desktop\java practice>javac HelloWorld.java

C:\Users\Ben\Desktop\java practice>java HelloWorld

//this is where your output would show from your java source code

I'ts also worth noting that you can compile & run on one line instead of two like so:

C:\Users\Ben\Desktop\java practice>javac HelloWorld.java && java HelloWorld

//output would show here

I am extremely grateful for your assistance. Thank you.

No problem. let me know if you have any other questions.

Most IDE's come with a built in console to them. Like Intellij IDEA, or Eclipse. Alternatively you could always use a text editor like Notepad++ to write your java source code, and then compile/run said java source code in your command prompt. Personally, I'm a huge fan of going the text editor route, then compiling/running in my command prompt.

No problem, one more question, how does the console locate my java file? Do I need to set its path?

Are you talking about using the text editor/command prompt route?