Paul Mayero

Be all you can be

Polish Notation

Typically, in mathematics we are used to seeing lots of expressions in the form of operand operator operand . For instance, addition of two numbers, say 1 and 2 would be expressed as 1 + 2 .

However, when it comes to functional languages like Clojure. This order is not honored anymore. Typical expressions are in the form of operator operand operand and this is the Polish Notation. Using our previous example, the addition of 1 and 2 would be expressed as + 1 2

Adding $JAVA_HOME on Ubuntu with 1 command

If you are new to Ubuntu and wanted to set Java path easily this is for you. If you have JDK 1.6+ installed already, just run the command below in your terminal window

jrunscript -e 'java.lang.System.out.println(java.lang.System.getProperty("java.home"));'

The command above will print out the path to where your java home is. Sample output on my terminal is

/usr/lib/jvm/java-8-openjdk-amd64/jre

Therefore, to add java home on Ubuntu with one command, the command below is for you 🙂

export JAVA_HOME="$(jrunscript -e 'java.lang.System.out.println(java.lang.System.getProperty("java.home"));')"

2 responses to “TIL: Polish Notation, adding $JAVA_HOME on Ubuntu with 1 command”

  1. Yay, another one!
    TIL that in functional languages, operators precede their operands.
    Thanks, Jan! 🙂

    Liked by 1 person

    1. You are most welcome. I hope you get to try this out with Lisp or Clojure when you get time. 🙂

      Like

Leave a reply to shayiris Cancel reply