Aug 03 2009

Java and the current work directory

Published by michael under Java

I spent some time looking this up and hopefully I will save someone else time on this. The current work directory for an application in Java is stored in the system property “user.dir”. This is the default directory that you application will write files to if you don’t specify an absolute file location. You can access it using this Java syntax:

String userDir = System.getProperty("user.dir");
Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Aug 02 2009

Maven pom.xml structure

Published by michael under Maven

I wanted to see the full Maven pom.xml structure and I found the following page on the Maven web site that contains all the elements and descriptions.

http://maven.apache.org/ref/2.2.0/maven-model/maven.html

Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

Aug 02 2009

OS X process ID and open ports

Published by michael under OS X / Apple OS

I had a need to identify what process ID (PID) on my MacBook running OSX that had a specific IP address and port open so that I could kill it. It took me a while to figure this out but eventually I found something that worked.

lsof -i

This will show you

COMMAND     PID     USER        FD   TYPE  DEVICE     SIZE/OFF  NODE  NAME
Microsoft   280     someuser    15u  IPv4  0x8862e64       0t0  TCP   *:3546 (LISTEN)
...
Share and Enjoy:
  • Print
  • Sphinn
  • del.icio.us
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Technorati
  • Twitter

No responses yet

« Prev