Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Saturday, 28 April 2012

The JVM finally moving forward

After almost a year of delay, Java 7 has been officially released for the Mac. SeeJava 7 Mac OS X download and README.
In order to use it in Eclipse and others, bear in mind that the PATH is now:
/Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents
This may be inaccesible to Eclipse, but you can paste the whole line, or create a symlink. It contains the sources, but no Javadocs.
This is a huge milestone, which marks the beginning of the end for Java 6, which was released 6 years ago. Technologies like Scala have soared since. But now with JDK 7 been readily available in all platforms, and with many bugfixes since the original release, it's time to upgrade. Last step will be JDK7u6 when the JRE will be fully availabe. See my previous post on Java 7, 8 and beyond
Update: After running a couple of scripts, I ran into this issue with UnknownHostException in JDK7
See this snippet:

This is my /etc/hosts
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
192.168.1.3 loki

Sunday, 16 May 2010

The end of the line

Ever wondered how to move to the start or the end of the line in the terminal in your MacBook? Ctrl+A and Ctrl+E respectively.

It also works on the Scala REPL, where you can quickly evaluate code snippets. Some useful tips here

Even while you surely know, home, end, page up and down are all accessible by combining the Fn + arrow keys.

Another end of the line shortcut is Shift+G in less. To tail that buffer do Shift+F (Ctrl+C to stop).

Enjoy!

Saturday, 15 May 2010

Vim syntax highlighting for Scala

Scala offers the flexibility to execute from command line (scala -e), through its REPL, as a script, or accessing the conventional main class. While REPL can be useful for quick hacks, the script has the advantage that it can be used for good shell scripts. On my Mac OS X Snow Leopard, (although it works on any unix) I configured vim as such:
curl http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/syntax/scala.vim -o .vim/syntax/scala.vim

curl http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/indent/scala.vim -o .vim/indent/scala.vim

curl http://lampsvn.epfl.ch/svn-repos/scala/scala-tool-support/trunk/src/vim/ftdetect/scala.vim -o .vim/ftdetect/scala.vim
then inside of vim, activate it:
:syntax on
Finally, to enable highlighting by default, add/modify your .vimrc and add the line
:syntax enable
Restart your console and you can now enjoy scala highlighting (although the color theme probably needs tweaking...)