开发者

Text (command line) based Java 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.


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.


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.


Do some reading about Tramp in Emacs as well. That allows you to run Emacs locally, but edit remote files as if they were local, using any of a variety of network protocols (but typically ssh). Shell commands initiated from a buffer editing a remote file will also execute on the remote server.

That's sort of the opposite of what you were asking for, and more useful when you don't want to have to set up Emacs and your custom configurations on another machine (or can't do so), but it's worth knowing about. If your local machine is running Windows, and you are using putty, you would need to use the plink method in Tramp.

I believe that vim has some similar functionality, also.

Or if you can mount the remote server's filesystem with sshfs, you would achieve a similar end result (local editor manipulating remote files), and potentially open up your options to utilise more familiar editors to do the work.


emacs and vim can do what you want. However unless you are familiar with these tools already, you should know that using them is nothing like using a GUI. I suggest you make it so you can edit source from your PC which are changed directly on your linux server. There are any number of ways you can do this.

I assume you don't have xwindows because this server is very limited??

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜