how to use eclipse workspace on different computers - eclipse

I have 3 developer machines (office desk, office laptop and home laptop) and I would like to keep my eclipse workspace and projects on usb drive and use it on all 3 computers... is this possible and how?

Though it is possible by indicating the folder on your usb to be your workspace, I'd recommend using version control if you have access to some server. This way you can work on your projects anywhere, have constant backup, and keep track of the changes.

Try using dropbox folders for your workspace (with their packrat feature its even better). That will keep all your files up to date :D.

Yes it is. Copy the workspace folder to your usb drive and open the workspace from any Eclipse installation you want to.
By the way, it may be a better idea to use a version control system. Sure, you'd have to synchronize your workspace every time you make a change in the code and commit it, but usb drives can get lost, or stolen, and I'm sure you wouldn't want to lose all of your projects if you lost your usb drive.

It's possible. Change your workspace to point to your shared drive. This is easier on OS's like linux as you can mount the USB drive to a specific directory.
Or, do what I do and copy the workspace directory for specific projects from one machine to another. This was covered here :
How to share eclipse configuration over different workspaces

Related

How to automatically-selectively backup critical files on edit?

I have just accidentally deleted one week of coding source files, and even testdisk does not restore them. Even executable jars gone... I use ubuntu. I dont want that happen ever again. How to sufficiently and efficiently make automatic backups (clones) of selected critical files to a different location e.g. home?
I use java, and eclipse as IDE, but this could be any file i work with. E.g. i select certain file, because i can accidentally delete it, so this lightweight backup tool would automatically update it in saved backup location according to saved changes. So if it is lost in working directory, as in my case, i can just take it from backup site on local machine. Pls help. I feel devastated...
cwatch might be a solution i am looking for, but it is too complicated.
p.s. i am aware of question Script to perform a local backup of files stored in Google drive
google services not ok for me.
The simplest solution would be to use GitHub or Bitbucket and to regularly push the changes you made to the online repository. You will benefit more from the usage of a version control software then from a local backup. You can use either of them for free.

How can you sync/share files from one computer to another in VS Code?

I am using 2 computers to code in VS Code, but I want to sync a specific file when I edit it in both computers. Do you have any extensions, or servers that allows it to sync?
I tried looking in Google, some said try FTP, and some said use "Settings Sync". (I installed Settings Sync, but I don't really know if it can sync my files.)
Option 1
Use vscode remote development.
Select main machine which would host all the files and use SSH to access the files from the other machine.
Option 2
Rsync is a standard linux tool which can be used.
Use can use vscode rsync extension for syncing the files from one machine into the other.
I think that the closest experience to what you have in mind that you can get currently on VSCode is Visual Studio Live Share. This is an official extensions suite that lets you share your screen with multiple hosts, it also shares most of your current VSCode editor features (like intellisense) and can be enabled with voice and text chats. I would also suggest to set up a git repository for the files you are going to work with, so that hard copies of all your files will be avaialble to all your users.

Eclipse files does not exist in workspace but does in remote system

I have a remote project in eclipse. Usually it works fine but sometimes, my explorer, says a file does not exist when I open it. The files does exist in my remote system explorer and in my local explorer file list, it just cant open.
Even if I refresh the project. Any suggestions.
Possible suggestions
You might be having your workspace in virtual machine, which keeps refreshing at regular intervals. Recommending to save your workspace in myDrive or myDesktop (yours) where it would be safe.
You eclipse might have synced up with version control( like svn/cvs) at remote. Always disconnect from your version control while you have with development work for the day. And i recommend you to make a local copy of remote repository in your desktop.

Synchronizing Eclipse project on Thumbdrive with PC

I have a thumb drive (memory stick, flash drive, etc.) on which I use for my projects when I am away from my home PC. Currently I am accessing my Eclipse project directly from my thumb drive when connected to my PC.
I would like to copy my files to the PC, develop on the PC, then "synchronize" with the thumb drive (update files on the thumb drive). I also need the reverse process too: synchronize thumb drive files with files on PC.
I have looked at the FileSync plugin, but it specifically says it is one-way.
How can I synchronize my Eclipse project both directions (PC to thumb drive and thumb drive to PC) on demand (I don't need this done automagically)?
Use a DVCS (git, hg), make sure to sync repositories when you're changing your work location. This will even let you work on the same file in multiple places and merge the result.
Use Unison
I'm assuming you're using Windows, so how about Sync Butler? Syncs the chosen folders automatically when the flash drive is plugged in.

Portable Eclipse

I'm trying to port my entire 'workspace' to a USB key (including the Eclipse executable) so that I can carry my work anywhere with me and work off the key directly.
My directory hierarchy is similar to this:
/workspace/eclipse - Where my current eclipse binary is stored
/workspace/codebase - Where I keep the root of all my eclipse projects
/workspace/resources - Where I keep all project files (images, docs, libs, etc.)
It all works perfectly fine on one system. But when I change over to another system, the USB key gets mounted on another drive. For example, on my laptop, I get 'E:\', on my PC, I get 'K:\' and at work I get 'F:\', etc, etc.
This means that because Eclipse (for 'some' reason) seems to only use full path names (including driver letters) in every single one of its configuration files (such as .classpath), nothing ever works when I want to work on another system.
I put a 'libs' directory in the base of every project and populate it with its dependent JAR files. Why doesn't it use relative names instead, so that I could specify something like "../../libs/log4j.jar"?
Anyone know how to fix this problem? Does anyone know of a workaround for this?
Update: 2010.11.09
I've recently discovered Dropbox, which allows you to sync your files online and across your computers automatically with extreme ease. It includes 2GB of free space and you can upgrade to much more if you want (for a yearly fee).
I installed it on my two laptops, my two PC's, my Linux server and my Android phone and then I created a 'workspace' directory within the 'My Dropbox' folder. From the 'workspace' directory, I then installed Eclipse and created/configured all my projects as usual. I can literally work from any computer and everything always stays perfectly in sync. This is way better than any USB key functionality and its hassle!
Have you tried using Eclipse Portable?
The only thing to keep in mind is that when switching the workspace, you need to remember to give it a relative path (like ../../Data/workspace).
You could use the dos command subst to get a consistent drive letter by creating a new virtual drive letter (say x:) that maps to your Eclipse folder on your usb drive, and then make all the config paths reference the drive x:
You could make a little batch file on the usb drive that you click on to create the drive x:
C:\>help subst
Associates a path with a drive letter.
SUBST [drive1: [drive2:]path]
SUBST drive1: /D
drive1: Specifies a virtual drive to which you want to assign a path.
[drive2:]path Specifies a physical drive and path you want to assign to
a virtual drive.
/D Deletes a substituted (virtual) drive.
Type SUBST with no parameters to display a list of current virtual drives.
You could also remap letter for your USB stick in Windows Disk Management (subitem in Computer management) to be smth like 'U:'.
Once done, it will be re-assigned to same stick every time you plug it. Not very universal, since your user need rights to access this setting first time, but it could help in some different scenarios.
You can always use Ant to build your programs, with Ant you can have relative paths... Plus you can also use Ivy to track dependencies in Ant, I do that in every project that I have.
Another alternative is to manually edit your .classpath files to contain relative paths.
It is a bit of a hassle, though, as you'll have to manually update the files whenever Eclipse changes them.