Pages

Run Java programs in gEdit with the press of a button

A simple hack to make gEdit a Java IDE

Add "External Tools" plugin from Edit -> Preferences (Plugins tab).


Select Tools -> Manage External Tools


1. Name it whatever you can identify it with. I named it "Compile & Run - Java"
2. Paste the below code into the text area

cd $GEDIT_CURRENT_DOCUMENT_DIR
if javac $GEDIT_CURRENT_DOCUMENT_NAME;
then
java ${GEDIT_CURRENT_DOCUMENT_NAME%\.java}
else
echo "Failed to compile"
fi
3. Assign a shortcut key. (e.g. F5)
4. Change appicability to Java and Close.

So, now run a program either by going to "Tools -> External Tools -> Compile & Run - Java" or just press F5 and don't forget to have fun! ;)

Sri

Srichakradhar (Chuck) is a disciplined, computer obsessed guy who likes to develop his ideas by making use of the technology available, mainly on web and mobile. He is also passionate and contributes to the society as an Art of Living volunteer. Apart from this he likes writing about technology and exploring the world with his awesome friends.

No comments:

Post a Comment