17

I do dev on a Windows machine and using docker via docker-machine. Due to help from @VonC was able to achieve folder share from windows dev folder to docker container.

The IDE I would like to use for Java development is Eclipse. But I would not like to install the whole java system on my host machine. And since my host machine is Windows (not an X system), can't use the X11 socket sharing stuff as mentioned here to install Eclipse into the container where Java resides.

So, if my code resides in my host machine and whole java subsystem is within the docker container, would Eclipse be able to build the code? Has anyone working on a non-Linux (preferably Windows) host got Eclipse IDE to build java applications using a java docker image to hold all things java.

Community
  • 1
  • 1
shrivb
  • 1,391
  • 3
  • 12
  • 20
  • Have you tried using VNC? I know the Selenium docker debug images allow you to observe test runs using VNC on Windows. – peater Dec 10 '15 at 17:21
  • [docker - Is it possible to install Visual Studio in a Windows Container - Stack Overflow](https://stackoverflow.com/a/41459500/233637) May be an answer. – tech_me Nov 03 '18 at 06:33
  • And why can't you use the "socket stuff"? Have a look at X-forwarding through ssh using putty and Xming. This way you can run any graphical application from any network-connected linux machine on your windows machine (including a docker container) – Arnout May 12 '19 at 16:18
  • You can run X window on windows, there are several options https://superuser.com/questions/99303/what-are-my-x-client-options-for-ms-windows – Gabriel May 19 '20 at 15:46

4 Answers4

4

You can achieve this behavior by using eclipse che:

https://hub.docker.com/r/eclipse/che/

Eclipse Che is a next-generation cloud IDE and workspace server that can run anywhere Docker runs.

By the way, it runs in a browser.

Another alternative is cloud9: https://docs.c9.io/docs/.

Mario Souza
  • 582
  • 5
  • 11
3

Take a look at https://github.com/fgrehm/docker-eclipse (authored by the same person as blog post)

Even when it is possible someone should care about making new images for every Eclipse version.

And I have just raised issue "run on Windows" #7 https://github.com/fgrehm/docker-eclipse/issues/7

Also see https://rgrunber.wordpress.com/2016/01/26/eclipse-inside-a-docker-container/ about using VNC

Paul Verest
  • 51,779
  • 39
  • 174
  • 288
2

I'm almost sure that there is no way (yet?) to run graphical applications within a Docker on a Windows host.

However you could still compile inside the docker (with the Java eco-system) and run Eclipse (or any other IDE) from your windows, by using volumes. But Java is embedded by Eclipse if I'm right... So I don't know what IDE you could use and not sure how to get all their features (IDE usually compile at every line you write to show compilation error graphically).

Anyway... My point is that you can use any IDE you like to edit your code, and any compiler you like (or even ANT, or MAVEN or ..) to compile inside a Docker.

Auzias
  • 3,064
  • 11
  • 34
  • The intellisense, real-time code compilation, etc are the reasons I would want to use an IDE like Eclipse. Otherwise I could just use an editor like Sublime, Notepad++, etc to just write code and compile/run from within docker. – shrivb Nov 30 '15 at 08:00
  • 1
    Then you _do_ need to run this IDE within the Docker but I can't see a way of running GUI app from Windows host... – Auzias Nov 30 '15 at 08:34
  • [docker - Is it possible to install Visual Studio in a Windows Container - Stack Overflow](https://stackoverflow.com/a/41459500/233637) It comes. – tech_me Nov 03 '18 at 06:31
  • 1
    @tech_me here it is for VSCode: https://code.visualstudio.com/blogs/2019/05/02/remote-development – pierrefevrier May 04 '19 at 15:01
-1

You can install native w32 eclipse, and run the builds from within docker as the answer on Eclipse - Docker integration explains

Gabriel
  • 129
  • 10