0

I've seen a few posts about this, but very few that provide an accurate answer.

In short, my brothers is just learning the smaller subtleties of Java, and I recommended him start off with Eclipse as, though a little intimidating at first, I find that it is the most flexible tool.

The problem is, that his professor (who said he may use any editor he wanted, FYI), told him to do some simple math by typing it into the console window.

The problem, is of course that the console isn't interactive in Eclipse.

Is there any plugin or magic that can enable such an interactive console for him? Personally, I've never needed it, but he's in a situation where he does, and I told him I'd consult the experts.

NOTE: Forgive the slightly technical question. I will gladly take it elsewhere if this is not the place to ask, but I couldn't think of any place better for a question about Eclipse.

asked Aug 27, 2014 at 17:16
1
  • I'm missing something here. If you have a java class with a public static void main(String[] args) { ...} method you should just be able to run it as a Java Application. You can get input from the console using a new BufferedReader(new InputStreamReader(System.in));. Commented Aug 27, 2014 at 19:09

3 Answers 3

4

You could use an Eclipse scrapbook page:

Create using "File / New / Other / Java / Java Run/Debug / Scrapbook Page"

Then write some code, select it and right-click Execute to run it.

This is not as interactive as javarepl, but it is native to Eclipse.

answered Aug 27, 2014 at 17:51
Sign up to request clarification or add additional context in comments.

Comments

1

I'm not aware of this functionality within Eclipse , but I believe this satisfies your need : http://www.javarepl.com/console.html

answered Aug 27, 2014 at 17:24

2 Comments

That being said , it's possible your brothers' professor intends him to write a simple program that enables him to type into the console . If this is the case I would advise to look at this : docs.oracle.com/javase/tutorial/essential/io/cl.html
I wanted to give you my thanks, despite not being exactly what I was looking for, I never knew such a utility existed. So here's a bump and a thanks!
1

You can create a "terminal" window to open jshell.

once created the terminal window can be opened from window - show view - terminal.

Create terminal

Terminal running

answered Nov 4, 2019 at 23:17

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.