forked from Rickfdalton/aliases-and-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzshrc-alias.txt
48 lines (39 loc) · 1.33 KB
/
zshrc-alias.txt
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Set Java version paths
export JAVA_17_HOME="/opt/homebrew/opt/openjdk@17"
export JAVA_11_HOME="/opt/homebrew/opt/openjdk@11"
export JAVA_8_HOME="/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home"
# Function to switch Java versions
switch_java_home() {
case $1 in
j8)
export JAVA_HOME=$JAVA_8_HOME
;;
j11)
export JAVA_HOME=$JAVA_11_HOME
;;
j17)
export JAVA_HOME=$JAVA_17_HOME
;;
*)
echo "Usage: switch_java_home {j8|j11|j17}"
return 1
;;
esac
echo "JAVA_HOME switched to $JAVA_HOME"
}
# Aliases to call the function for quick switching
alias j8='switch_java_home j8'
alias j11='switch_java_home j11'
alias j17='switch_java_home j17'
# save, open zshrc config
alias env-up='source ~/.zshrc'
alias env-edit='code ~/.zshrc'
# Open Tools
# open jar analyser tool. Download from : http://java-decompiler.github.io
alias open-jar='java -jar /Users/username/Downloads/tools/jd-gui-1.6.6.jar'
# open thread dump analyser. Download from : https://www.ibm.com/support/pages/ibm-thread-and-monitor-dump-analyzer-java-tmda
alias open-tdump='java -jar /Users/username/Downloads/tools/jca4616.jar'
# list listening ports
alias list-ports='lsof -i -P -n | grep LISTEN'
# kill process
alias down='kill -9'