7

I'm working on a Java project which has a nice Vagrantfile for setting up a development environment on Linux. I'm able to compile and run that application from within the Vagrant VM.

However, many of us use tools - IntelliJ, Eclipse, etc - outside of the VM. While it is easy to share files between localhost and the VM, it would be great to configure my IDE to use a remote compiler for things like autocompletion, static analysis, etc.

Is there a way to do this?

I know that I can do remote debugging in Java (a la -Xdebug, -Xrunjdwp, etc.) But what is the most straightforward way to do remote compiling? How can I configure my IDE (or just use the command-line) to invoke javac from the remote server and have an environment where all of my auto-completion and static analysis is based on my remote (vagrant) javac and JVM setting?

poundifdef
  • 18,726
  • 23
  • 95
  • 134
  • 1
    Possibly related to [Remote Java Compiler](http://stackoverflow.com/q/3837716/697630) – Edwin Dalorzo Aug 22 '14 at 18:53
  • 1
    I don't know about "remote compilers," but it seems you might be able to benefit from something like Continuous Integration. Send your source code to a remote server, where it is compiled and tested. Kind of the reverse of what you asked, but that's the use-case I'm familiar with. Look at [Hudson for Java.](http://hudson-ci.org/) – markspace Aug 22 '14 at 18:56
  • you can probably use putty – Deepanshu J bedi Aug 22 '14 at 19:03

1 Answers1

0

To my knowledge no Java IDE's exist that enables using a non-local JVM transparently.

However, if the virtual machine controlled by vagrant is powerful enough you can install the desktop for the distribution you use through the package system and then run a full IDE inside your vagrant image. For virtualbox you may need to use the virtualbox GUI to show the screen of the virtual machine in a window. You may also want to install the virtualbox tools.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347