How to create a run command for java in Komodo IDE
How to create a run command for java in Komodo IDE
I recently purchased the Komodo IDE and was able to create my own run Python command but, I am having trouble with creating one for java Can someone help me ?
I’m trying to create the run command for java. On the website it says you can create the run command and store it in the tool box. I just don’t know how and I know it does the syntax highlighting for java also, I already have eclipse for my java programs. I’m just trying to see if I can mainly use the Komodo IDE for everything.
– Candace
Aug 4 at 19:06
If you're just asking how to make a run command in Komodo then have a look at the docs. It should be straight forward: docs.activestate.com/komodo/11/manual/toolbox.html FYI, Komodo doesn't support Java as a first class language. There is no code intel, or debugging and the syntax colouring may not be up to date. Having said that, I used it when I was doing some intro Java classes a few years ago because I could write way faster in Komodo then Jetbrains or Eclipse.
– cgchoffman
Aug 29 at 16:56
1 Answer
1
Setting up prerequisites:
Within Komodo Edit (version 11.1 for this answer, method should apply for Komdo IDE as well) you can create your own runnable scripts and commands in the (Toolbox) Right Pane by right-click -> Add.
Komodo Edit
Toolbox
right-click -> Add
You'll need to have a JDK installed in order to add Java compilation functionality to your Komodo environment, and have your %JDK_PATH%bin appended to your environment PATH. Note: you'll have to restart Komodo just like terminal windows, after modifying your PATH variable for changes to take effect in context.
JDK
Komodo
%JDK_PATH%bin
PATH
PATH
One more preliminary thing to note is that you'll be using the javac and java executables of the JDK to compile and run your java files.
javac
java
java
On to the fun part:
RightClick -> Add -> New Command
Command
javac "%f" && java "%b"
Command
file base name
file base name without extension
Build & Run Java
Advanced Options
%D
Start in
directory path of file
Key Bindings
New Key Sequence
With that you're finished, save your setup with OK and you're ready to build and run your Java file. This will compile your java file into the appropriate class file via javac, and then run the compiled class via java.
OK
java
class
javac
java
If you have multiple classes you want to work with (eg. classes organized in packages which you'd like to include in a main entry point class), you could make a "Build" command wihout the additional Run (javac -d . "%F" && echo Build complete: %b), or building upon the above, you can go on to incorporate build lifecycle tools (eg. Maven) as a command.
javac -d . "%F" && echo Build complete: %b
Maven
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What exactly is the problem you're having and what is it that you're trying to do? Are you talking about a Toolbox Run tool? If yes, what have your tried? and what are you hoping to be able to do? FYI, Komodo doesn't support Java, though you should (I think, still not sure what you're trying to do) be able to do what you're asking.
– cgchoffman
Aug 3 at 16:18