Skip to content

Instantly share code, notes, and snippets.

@hamecoded
Last active January 31, 2018 16:05
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save hamecoded/df2f482f1501b14057f2 to your computer and use it in GitHub Desktop.
java
# JAVA_HOME
#1.7.0_55-b13
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
# same as
#export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home
#1.8.0_45-b14
# Apple installed java as seen in System Prefrences
#export JAVA_HOME=/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
#1.6.0_65-b14-462-11M4609
#export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
# export will resolve to /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
alias setjdk16='export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)'
alias setjdk17='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)'
alias setjdk18='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
# Uncomment this to disable bi-weekly auto-update checks
# DISABLE_AUTO_UPDATE="true"
# Uncomment to change how often before auto-updates occur? (in days)
# export UPDATE_ZSH_DAYS=13
# Uncomment following line if you want to disable colors in ls
# DISABLE_LS_COLORS="true"
# Uncomment following line if you want to disable autosetting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment following line if you want to disable command autocorrection
# DISABLE_CORRECTION="true"
# Uncomment following line if you want red dots to be displayed while waiting for completion
# COMPLETION_WAITING_DOTS="true"
# Uncomment following line if you want to disable marking untracked files under
# VCS as dirty. This makes repository status check for large repositories much,
# much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment following line if you want to shown in the command execution time stamp
# in the history command output. The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|
# yyyy-mm-dd
# HIST_STAMPS="mm/dd/yyyy"
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# export MANPATH="/usr/local/man:$MANPATH"
# # Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# set n the npm version manager to install locally instead globally /usr/local
#export N_PREFIX="$HOME/local"
alias lecompass="/Users/sagir/workspace/lp/compass.sh"
alias idiff="/Applications/Intellij\ IDEA\ 13.app/Contents/MacOS/idea diff"
export EDITOR='lime'
export EDITOR='subl -w'
# PATH - init the path so it ends with the default search locations
export PATH=/usr/sbin:/sbin:$HOME/bin:/usr/local/bin:/usr/bin:/bin
# PATH - for android sdk
export PATH=$HOME/Library/Android/sdk/platform-tools:$PATH
###################JAVA_HOME#############################
# jdk setup tutorial using jenv(manager) brew cask(jdk version downloader)
# http://davidcai.github.io/blog/posts/install-multiple-jdk-on-mac/
# JAVA_HOME - setting the JAVA_HOME env path (commented out since managed by jenv)
# export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
# aliases to change jdk not using jenv
alias setjdk16='export JAVA_HOME=$(/usr/libexec/java_home -v 1.6)'
alias setjdk17='export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)'
alias setjdk18='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)'
# Init jenv
if which jenv > /dev/null; then eval "$(jenv init -)"; fi
# brew cask install java => installs jdks according to the following directory structure
# echo $(/usr/libexec/java_home -v 1.8)
# /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
# jenv add /Library/Java/JavaVirtualMachines/jdk1.8.0_152.jdk/Contents/Home
# other place where you can find jdks on your system
# Apple installed java as seen in System Prefrences
# export JAVA_HOME=/Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home
# Apple prebuilt jdk path
# export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
#################################################
# TOMCAT
export PATH=~/apache-tomcat-7.0.61/bin:$PATH
# RVM
# PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
# RBENV
export PATH=$HOME/.rbenv/bin:~/.rbenv/shims:$PATH
eval "$(rbenv init -)"
# EC2
export EC2_HOME=/usr/local/ec2/ec2-api-tools-1.6.12.2
export PATH=$PATH:$EC2_HOME/bin
export PATH=$PATH:~/chromium/depot_tools
export PATH=$PATH:~/workspace/tooling/flutter/bin
# for user ec2-user
export AWS_ACCESS_KEY=
export AWS_SECRET_KEY=
export EC2_URL=https://ec2.eu-west-1.amazonaws.com
export PATH=$HOME/.node/bin:$PATH
# alias
alias cpwd="pwd | tr -d '\n' | pbcopy"
eval "$(grunt --completion=zsh)"
# run a local python web server from the directory at
alias web="python -m SimpleHTTPServer 8000"
#THIS MUST BE AT THE END OF THE FILE FOR GVM TO WORK!!!
[[ -s "/Users/sagir/.gvm/bin/gvm-init.sh" ]] && source "/Users/sagir/.gvm/bin/gvm-init.sh"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
export PATH="$HOME/.yarn/bin:$PATH"
# resulting PATH would be
# /Users/sagir/.yarn/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/Users/sagir/.node/bin:/Users/sagir/.rbenv/shims:/Users/sagir/apache-tomcat-7.0.61/bin:/Users/sagir/Library/Android/sdk/platform-tools:/usr/sbin:/sbin:/Users/sagir/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/ec2/ec2-api-tools-1.6.12.2/bin:/Users/sagir/chromium/depot_tools:/Users/sagir/workspace/tooling/flutter/bin
# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/sagir/workspace/tooling/google-cloud-sdk/path.zsh.inc' ]; then source '/Users/sagir/workspace/tooling/google-cloud-sdk/path.zsh.inc'; fi
# The next line enables shell command completion for gcloud.
if [ -f '/Users/sagir/workspace/tooling/google-cloud-sdk/completion.zsh.inc' ]; then source '/Users/sagir/workspace/tooling/google-cloud-sdk/completion.zsh.inc'; fi
# kill a stuck java process
ps -ef | grep java
kill -9 68894
# Standard double-clickable application bundles don't use JDKs installed under /Library/Java at all.
# Old-style .app bundles using Apple's JavaApplicationStub will use Apple Java 6 from /System/Library/Frameworks.
# New-style ones built with AppBundler without a bundled JRE will use the "public" JRE in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home - that's hard-coded in the stub code and can't be changed, and you can't have two different public JREs installed at the same time.
~ /usr/libexec/java_home -V
Matching Java Virtual Machines (3):
1.7.0_55, x86_64: "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home
1.6.0_65-b14-462, x86_64: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
1.6.0_65-b14-462, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
/Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home
@hamecoded
Copy link
Author

ps -ef | grep IntelliJIdea14 | grep 1099

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment