public
Created

Script to unpack Eclipse into reusable folder, with fresh workspace. Pass in -Dflags using single commandline arg in quotes

  • Download Gist
run-clean-eclipse
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#!/bin/bash
 
# for new workspace:
# cd ~/eclipse/42clean; ./e e
# to reuse workspace:
# cd ~/eclipse/42clean; ./e
# to pass in -vmargs flags
# cd ~/eclipse/42clean; ./e e "-Dsomething=somevalue"
# or
# cd ~/eclipse/42clean; ./e "-Dsomething=somevalue"
 
workspace=/home/nboldt/eclipse/workspace-clean42
target=/home/nboldt/eclipse/42clean
 
eclipse=/home/nboldt/tmp/Eclipse_Bundles/eclipse-jee-juno-linux-gtk-x86_64.tar.gz
eclipse=/home/nboldt/tmp/Eclipse_Bundles/eclipse-platform-4.2.1-linux-gtk-x86_64.tar.gz
eclipse=/home/nboldt/tmp/Eclipse_Bundles/eclipse-jee-juno-SR1-linux-gtk-x86_64.tar.gz
 
if [[ $1 == "e" ]]; then
echo "Wipe $target/eclipse and $workspace ..."
rm -fr $target/eclipse $workspace
echo "Unpack $eclipse ..."
tar xzf $eclipse
shift
fi
 
#export GDK_NATIVE_WINDOWS=true
./eclipse/eclipse -clean -showLocation -data $workspace -consolelog -console -vm /opt/sun-java2-6.0/bin/java -vmargs -Xms128M -Xmx256M -XX:PermSize=128M -XX:MaxPermSize=256M $1 2>&1 | tee "logs/eclipse.log.`date`.txt"

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.