path

How to copy the macOS Terminal path to the clipboard alvin May 15, 2017 - 9:24am

If you want to copy the current macOS Terminal path to the clipboard, you can do it with this simple command:

$ pwd | pbcopy

pwd prints the path to STDOUT, and pbcopy reads that and copies it to the macOS clipboard. Once the path is on the clipboard you can paste it into your other applications.

Of course you can also create an alias, like this:

alias path="pwd | pbcopy"

A worthy struggle has its own rewards

Working with yoga is often interesting. You stretch and twist and focus, trying to be very conscious of your movements, and then one day in the middle of a twisting pose you see your left foot coming out from behind your right ear. At first that’s a real surprise, a shock. You think, “Well, that can’t be MY foot over there,” and then you realize it IS your foot, and with that comes a strong sense of accomplishment, and maybe a little smile.

Then you do the same pose in the opposition direction, but twist and stretch as you might, your right foot doesn’t come out from behind your left ear. You know you can’t push it any more, at least not while doing the pose properly, so you realize there’s a bit of an imbalance. You accept that there’s still more work to do, but it’s a good thing, so you push on.

I think life is like that too, or can be like that. If you enjoy the struggle, if it’s a worthy struggle — a path with heart — the effort comes willingly, and with its own rewards.

“The path I have followed has been dangerous”

“The path I have followed has been dangerous, destabilizing more than calm, excruciating more than pleasant, and hard to integrate (into ‘normal’ everyday life). It has also been profound, amazing, and glorious. Surfing the ragged edges of reality has been easier than slowing the thing down.”

~ A quote from the book, Mastering the Core Teachings of the Buddha, by Daniel Ingram.

How to set the Java version on Mac OS X (macOS) systems alvin July 20, 2016 - 8:11pm

I don’t remember where I first found this line of code, but if you put it in your Mac OS X ~/.bash_profile file, it’s an easy way to set your Mac Java version:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

I can confirm this works with the Bash shell on Mac OS X 10.10. When I run the java -version command after opening a new Mac Terminal window, the output is 1.8.0_25.

A slightly more difficult way to set your Mac Java version is to look under the /Library/Java/JavaVirtualMachines directory to see which versions are installed, and then manually set the version.

Java/Scala - How to get the path to your Jar file

Last week I ran into a situation where I was bundling a Java/Scala application on a Mac OS X system, which (as usual) requires you to bundle your code in a Jar file. I was working with the jnativehook library, where I saw some code like this:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

How to show the full path to the current Finder folder

So, you're sitting there, looking at your Mac Finder window, and you see the file you need to work with, but wait ... what is the path to the directory you're looking at?

The Finder is a clever interface -- especially now that it sports four different views -- but at times like this, it just leaves you hanging. I run into this problem all the time when I go to upload a file using any of my web-based email clients, or when I upload a file using a web form.

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.

Glassfish JDK path problem solved

Glassfish JDK path problem: Some time ago I downloaded Glassfish, and then got away from it for a while. Today when I tried to run this command

C:\glassfish\bin> asadmin start-domain domain1

I got this error message from Glassfish:

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.