use Eclipse to edit source code file on virtual machine - eclipse

Currently I'm using a virtual machine (VM) environment on my laptop (Mac) for project development (i.e. virtual machine is running in VirtualBox on my laptop).
And I just use Samba to open code folder (on VM) and then I use SubLime (on my laptop) to connect to VM, so that I can edit code files (located on VM) from my laptop.
But I found SubLime is not efficient when I want heavy debugging for Java, so I would like to use Eclipse on my laptop, to edit and debug code files located on VM.
I tried to google but didn't find useful information, could you please tell me how to use Eclipse on my laptop, to open project on virtual machine?
Thanks a lot.

you can treat your virtual machine as a remote machine, then problem is solved.
Install the "Remote System Explorer" program for Eclipse
List item
Install the package on the desired programming language
Connection to the remote server with "Remote System Explorer"
Enabling programming language perspective
Open new remote project and edit
read here: Eclipse - Connect to a remote file system

Related

Visual Studio Code remote access to a WSL2:ubuntu on my desktop from my macbook

've looked around and can't seem to find the answer to this - probably because the feature is pretty new.
I tried the remote WSL:ubuntu connection on my windows desktop machine to connect to my WSL2 Ubuntu running on the same machine. This is pretty much perfect as it allows access to my Nvidia GPU under linux
Is there anyway I can do the same trick from my macbook? I can connect to the windows side of the desktop using the new remote tunnel feature but I'm drawing a blank on how to do for the WSL buried in that machine. It looks like it's just using the same remote connection feature so I'm thinking it should be possible but WSL2 network is not exposed the same way you can with a VM or other machine.
The desktop has way more everything than my macbook including a nvidia GPU I want to use for some machine learning.
I can do it from the desktop itself - but it's nice to be able to use that machine from my macbook at certain times of day.
I have recently started using VSCode so I'm on the learning curve with it - it may well be that it's not possible using the new remote tunnels - or requires some messing with adding a new hyper-v bridged adapter to the WSL installation. I'm hoping against hope there's an easy solve that I've somehow missed.
I tried setting up the remote tunnel as per https://code.visualstudio.com/blogs/2022/12/07/remote-even-better but it seems to setup a server to access windows not the WSL2 service.
Thanks for any help!
I had a similar problem and found this github issue. While the developers are looking into including this feature, you currently will need to install the VSCode CLI directly in WSL. You can find the downloads here
Notes
I would recommend the x64 CLI download in the Linux section. It will download a tar.gz file which will have a file named code in it when extracted.
The tunnel will launch from wherever you place that code file, so I put mine in the ~/ (home) directory.
You can then open a tunnel using the command ./code tunnel from that location. You can replace the . with the path to the code file to open the tunnel while in a different directory, i.e. ~/code.
You can still launch a tunnel from Windows with code tunnel. (note that this command does not have ./)

Running eclipse with remote Git checkout repository

On my windows laptop, I use putty to ssh on the remote server where I have git checkout a C project. I would like to use eclipse(CDT) for program development on my laptop but compilation and program execution is only possible on the remote server. Can I map the repository checked out on remote server into eclipse on my laptop so that I can avoid working with two copies of the checked out project.
This seems not possible unless you are using an Eclipse installed on the remote machine... and use it on your Windows laptop.
See "Remote Eclipse over X11".
Since you are on Windows, you would use an X11 emulator like vcxsrv.
That would avoid the sshfs setup.
The other approach would be to replicate your remote machine environment in a VM (VirtualBox) or a Docker image/container in order to be able to compile locally (and then push the modified sources to your remote machine with Git)

eclipse neon remote debug

I just installed the latest version of eclipse neon. I previously used eclipse mars. But due to other issues that should be updated in eclipse Neon I changed to this version.
I develop a program for a ARM Linux system on a Windows computer, so using a cross-gcc and doing remote debug using gdb/gdbserver from eclipse. I first made a connection using the remote systems perspective using ftp for file transfer and ssh for the shell. This worked fine and I was happy with this.
But in Neon it seems to be changed because the connection that I made in the Remote Systems explorer can't be selected anymore when you use C/C++ Remote Application Debug. When you look at the connection listbox I only see local connection and not the remote systems anymore. When I create a new connection from the debug configurations dialog I can only choose serial/telnet/ssh but when I choose ssh it doesn't work. I can make the connection and open a command shell, so ssh works. But when it wants to transfer the file to my target it is using sftp appearently (looking at the error log) but I don't have this on my target.
When I transfer the file manually to my target (using the remote systems perspective) the debugging works fine but of course I want to transfer the file automatically when I start a debug.
My question is if indeed this connection management is changed that you can't choose anymore the systems that you defined in the remote systems explorer?
Or do you need install a specific plugin?
The current configuration possibilities are very limited and also the debugging of the issues is limited.
Other solution is that I have scp installed on the target. Is there a way to change from sftp to scp?
Thanks.

How do I run eclipse remotely using Cygwin?

I'm running on Windows 7 and I want to be able to access the remote linux server at my school to run eclipse and do my programming assignments.
I installed cygwin, and ssh into the server, but whenever I run the "eclipse" command, it says "Eclipse: Cannot open display".
Is there any additional software I need to do, or commands I need to run in order to display the gui from my windows 7 computer?
aside from just running eclipse on my own computer, I want to do it remotely.
thank you
You need to:
Run an X server on your Windows machine; there's an xorg-server package in cygwin, use that (or the independent Xming).
Configure your ssh client to forward X11 traffic to the X server on your windows machine.
Here's a more detailed tutorial on doing this.

Eclipse RSE and xdebug - will this work?

I have a remote server connected over SSH using the RSE plugin in Eclipse Galileo. Is there anyway to "map" it to a PHP Debug session in Eclipse?
(Xdebug is installed and working)
I have heard that another solution is SSHFS but this might be tricky as I'm on WinXP and would prefer a 'generic' Eclipse solution.
The short answer is NO. RSE will not work with PHP Debugger. This might change in Eclipse Halios but I've not moved to Halios yet. The most common solution for Windows seems to be a virtual machine and share a samba mount of the remote webserver between the host and client. Not tried that yet either!
or i imported remote server through RSE so you can debug the remote server when you have the same copy locally. then whenever needed, i edit the local php files and they copy it from eclipse, got RSE, paste it there (overwrite).
it's a pain that RSE does not auto sync.