I found Atom editor as good free alternative to Sublime text editor. Not able to find a straightforward way to run a program in Atom editor. In my case, I am trying to run a java program. Please let me know if it's possible? If yes, please describe the steps to follow.
I find the Script package useful for this. You can download it here.
Once installed you can run scripts in many languages directly from Atom using cmd-i
on Mac or shift-ctrl-b
on Windows or Linux.
- Click on Packages --> Commmand Palette --> Select Toggle.
- Type Install Packages and Themes.
- Search for Script and then install it.
- Press Command + I to run the code (on Mac)
Script
, and restart Atom
, it works for me. –
Celebrate atom-runner
is better because when using Script
the code in current window moves a few lines horizontally. Maybe it's just a bit broken at the moment? –
Roane Script
works sometimes for me. I notice when I run Ruby scripts it try's to run Rails. It's wonky that way. I've noticed that shutting it down and starting Atom
back up works for a while. Too bad because I was starting to like working in Atom
, with VIM mode
. I always go back to VIM
or macvim
, I hope they fix Script
. Atom
has some nice features that I like over ViM
. –
Calibre Atom
but it works great in eclipse
or better in IntelliJ IDEA
(best editor for Java imho) –
Calibre For C
/C++
programs there's very good package gpp-compiler.
Shortcuts:
- To compile and run: F5
- To debug: F6
file/settings/keybindings
. –
Occupier You can go settings, select packages and type atom-runner
there if your browser can't open this link.
To run your code do Alt+R if you're using Windows
in Atom
.
If you know how to launch your program from the command line then you can run it from the platformio-ide-terminal
package's terminal. See platformio-ide-terminal
provides an embedded terminal within the Atom text editor. So you can issue commands, including commands to run your Java program, from within it. To install this package you can use APM with the command:
$ apm install platformio-ide-terminal --no-confirm
Alternatively, you can install it from the command palette with:
- Pressing Ctrl+Shift+P. I am assuming this is the appropriate keyboard shortcut for your platform, as you have dealt ith questions about Ubuntu in the past.
- Type Install Packages and Themes.
- Search for the
platformio-ide-terminal
. - Install it.
This package in Atom can run scripts.
press Alt+X for the running script.
For running javascript you need to install 'node js'
Also pressing ctrl+shift+i in atom gives developer option like chrome
you can test javascript code side by side in atom editor.
In order to get this working properly on Windows, you need to manually set the path to the JDK (...\jdk1.x.x_xx\bin
) in the system environment variables.
~\.atom\packages\script\lib\grammars.coffee
you will see that for building Java files on Windows it uses just filename without full path. I must say this is not what I expected, not convenient... –
Firooc grammars.coffee
should consider full path for the file. –
Rasla You can try to use the runner in atom Hit Ctrl+R (Alt+R on Win/Linux) to launch the runner for the active window. Hit Ctrl+Shift+R (Alt+Shift+R on Win/Linux) to run the currently selected text in the active window. Hit Ctrl+Shift+C to kill a currently running process. Hit Escape to close the runner window
You can run specific lines of script by highlighting them and clicking shift + ctrl + b
You can also use command line by going to the root folder and writing:
$ node nameOfFile.js
© 2022 - 2024 — McMap. All rights reserved.