Wednesday, May 27, 2015

JDK 7 on Mac OS X

It's been some time since I touched Java on Mac OS X, was mostly busy with native (C/C++) cross-platform development recently.
Here is just another note for myself before I forget.

After you install Java 7 on Mac OS X and you try to run java (or javac) it will still pick up the java 1.6 from /System/Library/Java/JavaVirtualMachines/1.6.0.jdk.

In order to fix this go to 
/System/Library/Frameworks/JavaVM.framework/Versions
and remove the CurrentJDK symlink.

Then create the new one to point to the JDK 1.7, in my case with the command:
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/ CurrentJDK

Now check the version: 
$ java -version
java version "1.7.0_79"
.............

Enjoy!


Wednesday, May 20, 2015

tcpdumping


Just a bookmark for myself, when wireshark is not avail.
This collects the full payload, only from the host  x.x.x.x and https port
and writes into the out.pcap file:

tcpdump -s 0 -w out.pcap -A host x.x.x.x and tcp port https