CodeTogether -- Remote Collaboration Tool

COMP 310    Java Resources  Eclipse Resources

CodeTogether is a plug-in for Eclipse (also supports VS Code and IntelliJ) that enables a host to share their Eclipse session with multiple remote users who can then simultaneous view and edit files in the host's Eclipse session. The remote uses only need to connect via a regular web browser.

IMPORTANT: Always remember that in a CodeTogether session, all code edits are only being performed on the host's machine, NOT on any remote user's machine!


Note that CodeTogether does NOT support audio or video connections, so collaborative work needs to be done in conjunction with an app that supports audio, video and/or chatting, such as Zoom.

Quick Start

Recommended View Setup

Setting up Eclipse to always show the CodeTogether control tab makes it always available, independent of the pop-up quick share setting. Tab may appear below or to the side of one's code panel, depending on one's Eclipse setup. The tab can be moved to wherever one wants it.


The CodeTogether control tab looks like this:


Start Sharing

By highlighting a section of code:

By default, when a few lines of code are selected, in a few seconds, CodeTogether is configured to pop up a little link to start sharing when sharing is not active:

Clicking the link will open the above CodeTogether control tab if it is not already open and start a sharing session..

Note: This behavior can be disabled through the Preferences setting for CodeTogether.

Through the CodeTogether control tab:

To start a sharing session as the "host", simply click the "Start Sharing" button in the CodeTogether control tab.


Once sharing has started, the CodeTogether control panel will look like this:

You can change your displayed name (defaults to "Host") by clicking the link under the currently used name.

Invite remote users

  1. Click the "Copy Invite URL" button to copy the unique session URL to your computer's clipboard.
  2. Send the URL to your collaborator(s) in any way desired, e.g. email, chat, etc.


Remote Users Join

When a remote user receives the invite URL, they simply need to open it in their desired browser. Eclipse does NOT need to be opened by the remote user as all work will be done on the host's Eclipse instance.

The first time that a remote user uses CodeTogether, they will be presented with a preferences page:

The remote user should choose:

Click the "Save and Continue" to proceed to the next step. This preferences page is only shown the first time but can be accessed from the next screen if desired.

The remote user should set a name to the system will use to identify them to the other users:

After setting the displayed name, click thge "Join Now" button. CodeTogether will remember your display name for the next time.


Remote User's View

A remote user will see a simplfied Eclipse user interface in their browser:


Host's View

The host's CodeTogether control panel will show all the connected remote users.

The host can see the remote user's cursor. Here is an example of what the host would see if the remote user, "XYZZY", hightlighted some text:


Code Together

Remote users have a special switch on their user interface called "CodeTogether" (the green slide in the above remote user's browser view). By default, this is on.

When the switch is on, "CodeTogether" will cause any change in cursor position by any user to show up in all other user's screens. This includes navigating to another file. Any editing changes will also be immediately seen by all.

Note that the host has no control over the activation of this feature -- it can only be turned on/off by remote users.

This feature is very useful when the host and remote user(s) are working and discussing the same code together.

Uploading files from remote users:

Remote users can upload files to the host's machine by simply dragging and dropping files onto the desired location in their Explorer view.

However, this is NOT RECOMMENDED when both parties are working from the same source control and the desired file is in the project of the remote user but not in the host's project. This is typical of partners working on team assignments. In that scenario, it is best to transfer the file via the source control system rather than through CodeTogether as this will ensure that all parties stay synchronized with their source control. Bypassing the source control to share files can lead to corruption of the repository and serious synchronization problems, possibily even code loss.

  1. The host should commit their project to make sure that the current changes are in the repository.
  2. The remote user(s) should do an update-to-head (Subclipse/Subversion) or the appropriate process to get the latest code from the repository as per the source control system in use. This makes sure that the remote user(s) get the host's code.
  3. The remote user should commit their code which should include the desired file. This puts the new file into the repository.
  4. The host should do an update-to-head (or whatever is appropriate) to get the new file. Any other remote users should also do the same to get the new file.

Code Alone

If a remote user switches "CodeTogether" off, i.e. wants to "code alone", then the other user's user interfaces are no longer tied to the movement of that remote user's cursor. Any edits by any user will however always immediately show up for all as any work done by any user is technically being performed on the host's Eclipse instance.

Coding alone enables a remote user to make view and make edits in other parts of a code file or in a different file without disturbing the other users. This is very useful whenever a remote user wants to temporarily go off and work on another part of the code. Remember that all work is always being done on the host's machine, not the remote user's machine!

If the remote users are truly working independently, then they should simply work on their respective separate Eclipse instances and use their source control's capabilities to synchronize their work.


Ending a sharing session

A remote user can leave a sharing session simply by closing the CodeTogether tab on their browser. If the host has not stopped the sharing, the remote user can rejoin with the same invite URL.

The host can stop sharing by clicking the "Stop Sharing" link in the CodeTogether control tab. This will disconnect all remote users and invalidate the invite URL.

Once the host has stopped sharing, the host should commit the code to the source control and all remote users should update their local Eclipse codebases to the newly committed code. No code changes will propagate to the remote users' systems until this is done!





© 2020 by Stephen Wong