How to run java programs in Atom editor

So by using process palette I shall be able to give input by cmd window ?

I did the setup for process palette, now what ?

If you used the same menu and keybinding options I showed, you can press f5 or the menu item it generated.

Yes.

I did what you told me to do in process palette and later I carried out a simple program to check whether I am able to run program using cmd ,but all I am getting is this

According to that message, you wrote start cmd /c ''javac {fileNameExt}'' instead of start cmd /c "javac {fileNameExt}". You can use either single quotes or double quotes for strings in code, but you can’t use two single quotes.

Now I am able to open cmd prompt but it is not asking for input from user (like enter the value if n ):sweat::sweat: it is showing a blank cmd . And one more thing the cmd prompt is not persistent it get removed after few second

And when I press f5 it show me this----- Uncaught TypeError: “file” argument must be a non-empty string

Does the same thing happen if you open a normal command line window, navigate to your Java/ folder, and type javac loop.java?

And one more thing the cmd prompt is not persistent it get removed after few second

You can use /k instead of /c, which will make the window remain open after the program has run. Alternatively, you can use && pause at the end of the command string (so it would be start cmd /c "javac {fileNameExt} && pause") to spawn a Press any key... prompt.

Please open the Keybinding Resolver (ctrl-.), press f5, and screenshot what you see in that panel. I can tell you more if I see that.

1 Like

Does the same thing happen if you open a normal command line window, navigate to your Java/ folder, and type javac loop.java ?

I didn’t get what were you saying in this line ?

The f5 key isn’t working because you have gpp-compiler installed and it’s being intercepted.

You need to test whether the behavior is the same or different when you run the file directly. I know you know what a command line window is, because you were just talking about them. If that’s not the hangup, what part of it are you having difficulty with?

So how do I test the behavior of cmd prompt so that it can run in file directly ?

I am able to enter the value in cmd prompt thanks mate @DamnedScholar !!! :heart_eyes::heart_eyes::+1::+1::+1::+1::+1::+1:

Have you gotten it to work with process-palette? Or does it only work when you use it directly from the cmd window you opened outside of Atom?

Through process-palette

suppose I used this will it cause problem to my previous config(using process-palette)?

You can leave process-palette installed. But use this maintained package instead:

Just realize that you are only getting a terminal inside Atom. Nothing more. Using the built-in terminal from your OS would have the same effect - it is just inside Atom’s interface. The commands will also look the same between the terminals.

Now you have to type in the command to the terminal as the process-palette handled in a preconfigured way.

1 Like

So you mean it is a substitute for process-palette?

There is overlap in functionality, but the one cannot over what the other can.

It is real nice to have a “formula” programmed into process-palette that can be used over-and-over again. The terminal program does not have that. Doing once-off tasks on the terminal however makes sense, especially when executing one task after another.

There is no crime in having both. Try the workflow of both and decide for yourself. My likes and dislikes would probably not work for you. Part of the process is getting the PC to work for you in the way that you want it to. You will not know what works if you do not ‘play’ with what is available.

That is my 2c.

1 Like

I use both for different things, though I also use Cmder for command line stuff, and I have it customized the way I want it, so I end up barely ever using a terminal inside Atom. It’s good when I want to run a quick command inside the folder I’m working in, but don’t want to take the time to set it up in process-palette, like npm install.

1 Like

@danPadric @DamnedScholar Thanks for providing such useful information I will surely try this :+1::+1:

1 Like