copy/transfer eclipse from one ubuntu(linux) machi

2019-04-12 04:58发布

问题:

I have eclipse downloaded on one of my ubuntu machines. and now I want eclipse on my other ubuntu machine. how can I do this?

回答1:

In the computer you have eclipse installed:

Backup the folder containing eclipse (usually it's in the /opt folder)

sudo cp -r /opt/eclipse /folder/to/backup/eclipse

In the one you want eclipse to be installed:

  1. Copy eclipse to the opt folder

sudo cp -r /backup/eclipse /opt/eclipse

  1. Add read permission to all files

chmod -R +r /opt/eclipse

  1. Add the executable bit to the eclipse binary

chmod +x /opt/eclipse/eclipse

  1. Add an executalbe entry to /usr/bin

sudo touch /usr/bin/eclipse

sudo chmod +x /usr/bin eclipse

  1. Edit the created file with your favourite editor.

sudo gedit -w /usr/bin/eclipse

and paste the following content:

#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse" 
$ECLIPSE_HOME/eclipse $*

At this point you should be able to run eclipse from command line, If you want to add a desktop entry, investigate how to do this in your desktop environment.