Customizing and Installing Eclipse via Command Line

Do you know that it is possible to configure any Update Site and install any Eclipse feature from it without launching the Eclipse user interface?

Yes! Thanks to the p2 director application this is possible! You just only need to provide some very basic information and the installation can proceed automatically without any user interaction. Examples and a complete reference of the different options available can be found in the Installing software using the p2 director application help page.

Based on this procedure, I have created some quick shell scripts for personal use to download and install Eclipse in an unattended way. The scripts support Windows, Linux and Mac OS X systems. This is an example of the execution of the script in Windows:

C:\Users\username\git\eclipse.installation\papyrus-marte>.\install-eclipse-neon-x86_64.cmd
************************************************************
Checking previous installations...
Getting installation package...
Downloading archive http://archive.eclipse.org/eclipse/downloads/drops4/R-4.6.3-201703010400/eclipse-SDK-4.6.3-win32-x86_64.zip
Downloaded (3789K of 213076K) [0%]
Downloaded (6020K of 213076K) [3%]
Downloaded (11238K of 213076K) [5%]
Downloaded (20365K of 213076K) [10%]
Downloaded (32674K of 213076K) [15%]
Downloaded (41332K of 213076K) [19%]
Downloaded (54373K of 213076K) [26%]
Downloaded (61500K of 213076K) [29%]
Downloaded (72012K of 213076K) [34%]
Downloaded (81544K of 213076K) [38%]
Downloaded (91980K of 213076K) [43%]
Downloaded (105033K of 213076K) [49%]
Downloaded (113687K of 213076K) [53%]
Downloaded (120750K of 213076K) [57%]
Downloaded (128260K of 213076K) [60%]
Downloaded (141049K of 213076K) [66%]
Downloaded (157021K of 213076K) [74%]
Downloaded (171656K of 213076K) [81%]
Downloaded (178211K of 213076K) [84%]
Downloaded (186356K of 213076K) [87%]
Downloaded (194628K of 213076K) [91%]
Downloaded (199337K of 213076K) [94%]
Downloaded (204809K of 213076K) [96%]
Downloaded (209454K of 213076K) [98%]
Downloaded (218189934K of 213076K) [100%]
Extracting C:\Users\username\AppData\Local\Temp\tmp58F3.tmp into C:\Users\username\AppData\Local\Temp\tmp5913.tmp...
Configuring (this may take a while, please be patient)...
Installing org.eclipse.papyrus.sdk.feature.feature.group 2.0.3.201703080851.
Installing org.eclipse.papyrus.extra.marte.feature.feature.group 1.2.0.201703081153.
Installing org.eclipse.papyrus.extra.marte.properties.feature.feature.group 1.2.0.201703081153.
Installing org.eclipse.papyrus.extra.marte.textedit.feature.feature.group 1.2.0.201703081153.
Operation completed in 260108 ms.
Configurations finished
Installing...
Done
************************************************************

C:\Users\username\git\eclipse.installation\papyrus-marte>

If you think this is interesting, please check the code in https://github.com/abelgomez/eclipse.installation 😀