简体   繁体   中英

Looking for a terminal based IDE to work over SSH - Java

I'm spending a lot of time to look for a Java IDE but I cannot find one that suits my purpose. I normally use Eclipse due to it's multi-language functionality and massive free support. I'm looking for something similar, but it needs to work with SSH.

I'm running Diet Pi on my old Raspberry B+. It's working with Java 11 (32-bit). I'm in need of Pi4J project because I'm going to program embedded in Java. So I need an IDE that can handle SSH text terminal and Maven/Gradle support because I'm to lazy to look up .jar files by my self.

Does anyone know of such an IDE?

Since nobody has responded yet, look for an emacs customized for Java. It's amazingly powerful but I could never get past the complexity myself.

https://www.gnu.org/software/emacs/

http://www.goldsborough.me/emacs,/java/2016/02/24/22-54-16-setting_up_emacs_for_java_development/

It should already be on your RPI or it should be a trivial apt-get.

I'm sure someone will post soon with a better sales pitch.

VI can be a reasonably good code editor as well, but again takes a little customization and a learning curve--but if you are going to use Linux, just go ahead and learn enough vi to edit and save a file anyway, you will need it someday.

Eclipse over ssh (Additional answer):

This isn't the easiest setup in the world, but ssh is one of the most flexible tools in unix. You can have it create a "Pipe" between your computer and the remote computer (Like a VPN). You can then run RDP over this pipe which will let you run any program that is on your RPI.

I'm afraid I haven't done this in quite a while and don't know the options offhand, but googling "RDP over SSH" gave me some good looking answers (Using Putty which will simplify things a lot).

Mount the drive and run eclipse "Locally" (On your desktop)

You should be able to mount your RPI drive on your local system and use Eclipse there. I googled "Mount ssh" and found stuff like:

https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh

Which includes Linux and windows solutions.

If you put your entire project directory on the "RPI", then the jar should be built there as well and you can just flip over to the PI to run it.

These Linux tools are SO flexible--there are a hundred solutions to every problem. You just have to pick a direction and go.

I guess I could list some advantages/drawbacks as long as I'm here typing:

console based solutions:

  • vi is everywhere
  • You need to learn some anyway.
  • EMACS is very powerful
  • Both are annoyingly hard to setup and learn

Running your PI on your desktop via SSH:

  • Easy setup
  • Nothing new to learn
  • Might be slow (IDE running on RPI plus network lag)
  • Not terribly flexible, it's going to work or it won't.

Mounting your PI drive on your desktop:

  • Should be pretty straight-forward
  • Reasonable performance (May slow down saving/rebuilding project)

Finally I guess I should mention yet a fourth solution, build on your desktop and copy (Deploy) to RPI:

  • This is probably how a "Professional" would do it
  • Fastest & most reliable solution all around since your IDE is running on your desktop.
  • Use SCP as part of build to "Deploy" build artifacts to the RPI
  • You get to use awesome enterprise words like "Deploy" and "Process"
  • an SCP based Deploy can be built into your Gradle script
  • Deploy process can auto-unpack/auto-run your target so you never even need to log into the PI
  • Most flexible solution, you can do anything with tools like SSH and Gradle.

Other hints:

  • Be sure you are using a private key to log into ssh, NEVER passwords.
  • Learn SSH options, there are a lot and they are nearly all great.
  • Once you get rid of passwords you can use ssh to "Send" commands to the PI without manual interaction, this can be really handy to stick things in your gradle script like "start app", "kill app", …

There, that should keep you busy for a while.

Did you try to Visual Studio Code? The official version is 64-bit only, but you can install an older one which is still available in 32-bits version. With additional Java plugins (which it will propose to install if you open a Java project), this is a great tool on Pi!

$ cd /home/pi/
$ wget https://github.com/stevedesmond-ca/vscode-arm/releases/download/1.28.2/vscode-1.28.2.deb
$ sudo apt install ./vscode-1.28.2.deb

To install Maven on Pi:

$ sudo apt install maven

Check the installation by requesting the version:

$ mvn -v
Apache Maven 3.6.0
Maven home: /usr/share/maven
Java version: 13-BellSoft, vendor: BellSoft, runtime: /usr/lib/jvm/bellsoft-java13-arm32-vfp-hflt
Default locale: nl_BE, platform encoding: UTF-8
OS name: "linux", version: "4.19.66-v7l+", arch: "arm", family: "unix"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM