Is it possible to test interactive Java 8 code in Atom?

Title; interactive as in with inputs from the user.

Using the “script” package, I am able to run non-interactive code. Interactive code runs too, but you cannot actually input anything…

I know for Java 9 and above one should be able do this via Hydrogen + IJava kernel, however I need to work with Java 8.

If you have some Java (or other) code you can run it in your usual external terminal or other app by passing FilePath arg through process-palette - this is my preferred workflow rather than trying to get Atom packages to work. I see little advantage in embedding terminal into Atom. Use Atom in a toolchain for development. process-palette process settings allows me to add a topbar dropdown item - Run Java, Python … etc.

Thanks! Could you - or anyone else - help me set up process-palette for running Java? I found this thread:

… but the steps outlined there don’t seem to work for me.

You will need to study Process Palette documentation > Settings.

It is true that it can be tricky to setup first time.

But looking at my own custom processes I created here are the Java settings:

General
Namespace: process-palette
Action Name: run-java
Shell Command: java {fileDirAbsPath}/{fileName}
Working Directory:
Key Stroke:
Menu: Run, Java

Note: Above Shell Command path with {fileDirAbsPath}/{fileName} applies to Unix. Use {fileDirAbsPath}\{fileName} for Windows.

In other words, I prefer using Menu to Key Strokes.
Other settings you might choose to tweak but the above is all I need to run the command line.

Now in my top menu bar I have a custom entry Run and that dropdown now lists Java > Run Java.

process-palette2

[P.S]
Be aware that you can also “team” Atom with other tools in a toolchain.
So for Java you can have in Atom a custom process-palette command to pass arguments to JEdit. This allows JEdit ecosystem to be used through Atom.

And further note.
You can use HaXe to generate Java.

Again create a process-palette command to compile through HaXe.

Thanks again, though I can’t get your suggestion to work either. I get:

image

… which I don’t understand at all because none of my files are named “Week”, the files are in a folder named “Week 1”, but they and the class are all named “Exercise”…??

Might be because Linux (which I use) uses forward slashes and Windows back slashes in paths. Get java System Command to work in your normal terminal (sans Atom) then transfer into your process-palette setting. Above post now clarified.

Does this apply for you …

java {fileDirAbsPath}\{fileName}

I am on Windows, but that doesn’t help sadly. I think I might just give up on this and stick to notepad and the command line…

If you figure out how to run in command line then there is absolutely no reason why you cannot transfer this path intoprocess-palette.