Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text (command line) based Java IDE

Tags:

java

emacs

ide

Probably question title might looks strange for you, but I'll try to explain.

I do looking alternative of desktop eclipse, ideally what I need is to edit sources directly on my linux dev-server. On dev server I don't have any xwindows just command line. So I would like to login to server using Putty, develop, build, run, commit changes to source control system.

From text editor I would need:

  • syntax highlight
  • autocomletion (at least basic)
  • quick navigation trough project files
  • basic refactoring: change class name? move class to other package,change method signature
  • run build without need to leave editor window
  • run svc/git commands without need to leave editor window

From the first glance emancs seems to be what I need, but I don't sure.

Thanks.

like image 601
Andriy Kopachevskyy Avatar asked Dec 13 '22 09:12

Andriy Kopachevskyy


2 Answers

I think that you approach is not good. Developing directly on your devel server is not a good practice. But it's not the question...

Personally, my favorite text editor for programming is emacs. I'm also a Java developer. I'm using Eclim. According to the Eclim Website :

The primary goal of eclim is to bring Eclipse functionality to the Vim editor. The initial goal was to provide Eclipse’s java functionality in vim, but support for various other languages (c/c++, php, python, ruby, css, html, xml, etc.) have been added and several more are planned.

As I said, I use mainly Emacs. So, I'm using emacs-eclim (the Vim plugin is very cool and advanced) :

Eclim is an Eclipse plugin which exposes Eclipse features through a server interface. When this server is started, the command line utility eclim can be used to issue requests to that server.

Emacs-eclim uses the eclim server to integrate eclipse with emacs. This project wants to bring some of the invaluable features from eclipse to emacs.

If you use Emacs, you can also use the JDEE mode. Personally, I don't like this mode : too complicated, not enough maintained.

like image 116
Sandro Munda Avatar answered Dec 29 '22 18:12

Sandro Munda


Sandro's answer is a good one for a true command-line tool. On unix, emacs and vim are really the only games in town when it comes to sophisticated command-line editors, so a good Java mode for one of those is what you want.

However, i want to point out that even if the server doesn't have an X server, you can still run graphical programs on it - they just have to connect to an X server on another machine, such as your desktop. Sounds weird, but that is actually the whole point of X windows: it was originally developed so that people could run programs on powerful time-shared machines, and access them from cheap, dumb graphical terminals (this was back in the early 80s when people thought that was a good idea).

These days, the easiest way to do this is to use SSH to connect to the remote machine, telling it to enable X11 forwarding. With the OpenSSH command-line SSH, this is as simple as adding the -X flag; i'm not sure how you do it with PuTTY, but i'm sure it's possible. Once you've logged in with X11 forwarding enabled, you can simply run X clients (such as Eclipse or IDEA), and they will connect to your local X server.

Oh - you will need a local X server. On Windows, you can install Xming

All of this takes a bit of work (although not a lot!), so if you just want to do occasional hacking, my all means go with Eclim. But if you are planning on doing a lot of remote development, and you don't have a lot of affection for curses interfaces, this might be the most comfortable route.

like image 24
Tom Anderson Avatar answered Dec 29 '22 16:12

Tom Anderson