Setting java aliases with zshell on Mac

When I’m working on different versions of Java, I set up a bunch of aliases so I can run commands quickly and compare differences. I recently upgraded my Mac and accepted the default shell as zshell instead of bash. (This change was made a long time ago but I didn’t upgrade for a long time because I didn’t want to incur the risk of being without my computer when everything was closed for the pandemic.)

Since I needed to move this from .bash_profile to .zshenv, I took the opportunity to shed a lot of them. I now have just Java 11 and Java 17 that I am using for comparisons. (LTS to LTS).

My .zshenv now contains this. (Yes, I know I should have patched Java 11, but alas.) I ran “source .zshenv” and am good to go.

Now I can run java11 JeanneTest.java and java17 JeanneTest.java to easily compare differences.

alias javac17=/Library/Java/JavaVirtualMachines/jdk-17-ea.jdk/Contents/Home/bin/javac
alias java17=/Library/Java/JavaVirtualMachines/jdk-17-ea.jdk/Contents/Home/bin/java
alias jar17=/Library/Java/JavaVirtualMachines/jdk-17-ea.jdk/Contents/Home/bin/jar
alias javac11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/javac
alias java11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/java
alias jar11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/jar
alias jshell11=/Library/Java/JavaVirtualMachines/jdk-11.0..jdk/Contents/Home/bin/jshell
alias jdeps11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/jdeps
alias jmod11=/Library/Java/JavaVirtualMachines/jdk-11.0.11.jdk/Contents/Home/bin/jmod

export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk-17-ea.jdk/Contents/Home"

Happy Book Birthday! OCP Java 11 Practice Tests Now Shipping!

Jeanne and I are ecstatic to announce our new book, OCP Java 11 Practice Tests, is now shipping! It’s the first book in print custom written for the new 1Z0-819 Java 11 Certification Exam as well as the 1Z0-817 Java 11 Upgrade Exam.

Want to become Java 11 Certified but not sure where to start? Purchase our new Java 11 Practice Tests book along with our Java 11 Complete Study Guide, now available as The Java 11 Complete Certification Kit. While Oracle restructured the 1Z0-815 and 1Z0-816 Exams into the 1Z0-819 Exam, the material is almost identical (see this post for more details), making the Java 11 Complete Study Guide along with our new Java 11 Practice Tests Book the best source of material for learning everything you need to become a Java 11 Certified Professional!

Like our previous books, we will post any updates or notes on this blog’s Java 11 Practice Tests Book page.

A special thanks to all of our friends and family that helped write this book in the midst of the global pandemic. It’s been a challenging year and we couldn’t have done it without your support!

Update: Java 11 Practice Tests

Jeanne and I know many of our readers are anxiously awaiting their copy of our new Java OCP 11 Practice Test Book for the 1Z0-819 Exam, originally expected out this month. The good news is we finished the manuscript a few months ago, so the book is done! The bad news is, the publishing and printing process has been slower than expected given everything going on in the world.

We now expect the book to be available in late January/early February. Believe us, no one is more anxious for this book than us! If you purchase the book from Amazon or other resellers, it will ship as soon as it is available!

Oh, and a big thanks to all our readers this year, whose feedback and support has kept us going in these strange times!