Importing Maven Project from a Cloned Git Project into Eclipse Juno SR2 with m2e

I was having some funky issues with Eclipse and m2e not properly reading the pom.xml and setting up the .classpath properly when importing an existing Maven project into Eclipse from a cloned git repo.

When I did the following:

  • Go to File/Import/Maven/Existing Maven Projects
  • Chose the root dir of the the existing directory

I got the following error:

An internal error occurred during: “Updating Maven Project”.
Unsupported IClasspathEntry kind=4

Initially, I solved it with a series of back-and-forth commands in both Eclipse and on the commandline to finally satisfy Eclipse that the dependencies were satisfied.

Thanks to the help of a friend I found a much easier process which enables me to cleanly clone, and import into Eclipse.

  • Clone your git repo
  • On the command-line in the same directory into which you cloned your source run:
    • $ mvn eclipse:eclipse; mvn eclipse:clean
  • Open Eclipse
  • Select File/Import/Maven/Existing Maven Projects
  • Browse to the directory into which you cloned your source and select that directory
  • Click ‘Finish’ in the dialog box

You should now have your project in Eclipse without any compile/dependency errors.

Fixing Compile Error: undefined reference to ‘dclose’ (dlopen, dlsym, and/or dlerror)

I am running an Ubuntu 12.10 machine and I had to compile and install a jsvc binary for an older version that I didn’t have a package that I could install via dpkg or apt-get install.

Running configure came off without a hitch.

Running make resulted in the following error:

gcc -ldl -lpthread jsvc-unix.o libservice.a -o ../jsvc
libservice.a(dso-dlfcn.o): In function `dso_unlink’:
/usr/local/src/daemon-1.0.1/src/native/unix/native/dso-dlfcn.c:41: undefined reference to `dlclose’
libservice.a(dso-dlfcn.o): In function `dso_link’:
/usr/local/src/daemon-1.0.1/src/native/unix/native/dso-dlfcn.c:36: undefined reference to `dlopen’
libservice.a(dso-dlfcn.o): In function `dso_symbol’:
/usr/local/src/daemon-1.0.1/src/native/unix/native/dso-dlfcn.c:47: undefined reference to `dlsym’
libservice.a(dso-dlfcn.o): In function `dso_error’:
/usr/local/src/daemon-1.0.1/src/native/unix/native/dso-dlfcn.c:52: undefined reference to `dlerror’
collect2: error: ld returned 1 exit status
make[1]: *** [jsvc] Error 1
make[1]: Leaving directory `/usr/local/src/daemon-1.0.1/src/native/unix/native’
make: *** [native/all] Error 2

I double checked that the Ubuntu packages that provide those libs were installed (libc6 and libc6-dev).

It turns out that, for some reason, under this distro that the GCC linker requires the -ldl argument to be listed last.  So that the invocation of:

gcc -ldl -lpthread jsvc-unix.o libservice.a -o ../jsvc

needs to be:

gcc jsvc-unix.o libservice.a -o ../jsvc -lpthread -ldl

To make this happen, do the following:

Edit configure:

For your $host_os update:

LDFLAGS=”$LDFLAGS -ldl -lpthread”

to

LDFLAGS=”$LDFLAGS -lpthread -ldl”

Run # ./configure

Then edit the ./native/Makefile:

jsvc: jsvc-unix.o libservice.a
        $(LDCMD) $(LDFLAGS) jsvc-unix.o libservice.a -o ../jsvc

        to

jsvc: jsvc-unix.o libservice.a
        $(LDCMD) jsvc-unix.o libservice.a -o ../jsvc $(LDFLAGS)

# make

It should compile without any complaints

Configuring the Number of Workspaces on Ubuntu 12.10

I typically like to have more than 4 workspaces for my X Windows sessions.

Under Ubuntu 12.10 there is a little trickey involved in updating the default configuration.

First you need to install the compizconfig-settings-manager.  This will enable you to configure the workspace switcher and some other system configs.  Be careful, this will also allow you to break things so only configure what you understand via compizconfig-settings-manager.

Install ccsm:

  • # apt-get install compizconfig-settings-manager

To run invoke (as root):

  • # ccsm

To configure Workspace Switcher:

  • Go to ‘General Options’
  • Click on ‘Desktop Size’ tab
  • Edit the ‘Horizontal Virtual Size’ and ‘Vertical Virtual Size’ to add additional workspaces

 

Click the ‘Back’ and then the ‘Close’ button

Running a Headless Virtual Machine under VMPlayer

If you want to run a headless VM under VMPlayer simply add the following to your vmware preferences file ($HOME/.vmware/preferences):

pref.vmplayer.exit.vmAction = “disconnect”

Restart VMPlayer and fire up your VM.  When you quit that VMPlayer instance it will ask you if you are sure that you want to quit and leave the virtual machine running.

When you quit the player the VM will now be running headless.

Preventing resolv.conf From Being Automatically Overwritten with Each Restart or network restart

I am running CentoOS 6.3 and have set up a local nameserver.  As a result, I’ve customized my version of /etc/resolv.conf to include both the IP of my local nameserver as well as a domain and search configuration directives.

When I restarted the machine, or if I restarted networking resolv.conf was overwritten.

It turns out that the contents of the ifcfg-ethN files determine how the network scripts behave and how, or if resolv.conf is modified programatically.

To prevent this make sure NOT to include a DNS1 (or 2, etc) entry in your ifcfg file and make sure TO include a PEERDNS=no entry.

Tabbing To Links Problems in Browsers under Mac OS X

I am working on building some 508 Compliant/Accessible web sites and am testing out how well the navigation works using only the tab key.

Under Mac OS X with Firefox, Opera, and Safari, by default, the tab key does not cycle through all of the links on a web page.

Firefox:

  • Go to: System Preferences/Keyboard/Keyboard Shortcuts
  • Click on the ‘All controls’ radio button towards the bottom of the dialog under the text that says: ‘Full Keyboard Access: In windows and dialogs, press Tab to move keyboard focus between:’

Safari:

  • Enabling the aforementioned setting does not do it for Safari
  • Go to: Safari/Preferences/Advanced
  • Under ‘Accessibility:’ click on the checkbox next to ‘Press Tab to highlight each item on a a wepage’

Opera:

  • Go to: Opera/Preferences/Advanced
  • Click on ‘Shortcuts’ in the left-hand nav of the dialog
  • Select ‘Enable single-key shortcuts’
  • Opera does not implement keyboard navigation the way most other browsers do.  To step through the links on a page, press the ‘Q’ key to go forward, and ‘A’ key to step backwards through the links on the page.  ‘W’ and ‘S’ keys you to navigate between headings <hn> tags.

Chrome:

  • Go to: Chrome/Preferences
  • Scroll all of the way down to the bottom of the settings page and click on ‘Show Advanced Settings’
  • Scroll down to ‘Web Content’
  • Check the box next to ‘Pressing Tab on a webpage highlights links, as well as form fields’

Allowing Popups in FireFox from Locally Sourced Files

If you want to allow a popup from a file accessed via file:///home/rchapin/some_dir/somefile.html, open FireFox’s Preferences, click on the Content tab, and click on the ‘Exceptions’ button adjacent to the ‘Block pop-up windows’ check box.

Then enter ‘<file>’ in the ‘Address of website:’ field and click the ‘Allow’ button.

How to Add an Application to the Mac Approved Software List

I am installing Eclipse on Mac OS X Mountain Lion.  Unpacking the
.tar.gz was no problem, however, when I went to run it for the first
time I got the following error message:

Your security preferences allow installation of only apps from the Mac App Store and identified developers

To add Eclipse to the list of ‘approved’ applications run the following command in a terminal:

xattr -d com.apple.quarantine /path/to/Eclipse.app

Changing the VMWare vmnet IP Range when it Conflicts with a VPN on Mac OS X

If you are running both VMWare (in my case VMWare Fusion 5) and a VPN that uses the 192.168.203.0 subnet you will may need to update the ip range that is used for the vmnet.

In my case, vmnet8 was configured to use 192.168.203.0 and so was a VPN connection that I was using.

As a result, if I fired up VMWare first and then attempt to make a connection to the VPN, I could not route to any of the 192.168.203.0 hosts.

Following is what you need to do on a Mac running OS X:

        . Shutdown VMWare Fusion (simply quit the program.  It must stop the vmware_* services)

        . edited: /Preferences/VMware Fusion/networking
                . Updated answer VNET_8_HOSTONLY_SUBNET 192.168.203.0 -> answer VNET_8_HOSTONLY_SUBNET 192.168.247.0
                . /Preferences/VMware Fusion/vmnet8/dhcpd.conf and /Preferences/VMware Fusion/vmnet8/nat.conf will be automatically updated by VMWare with the config change

        . Fire up VMWare Fusion:

# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
default            10.1.10.1          UGSc           27        0     en0
…
172.16.19/24       link#8             UC              1        0  vmnet1
192.168.247        link#9             UC              1        0  vmnet8

        . Connect to VPN:

# netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags        Refs      Use   Netif Expire
…
172.16.19/24       link#8             UC              1        0  vmnet1
192.168.12.156     192.168.12.156     UH              5        0   utun0
192.168.200.120/32 192.168.12.156     UGSc            1        0   utun0
192.168.201        192.168.12.156     UGSc            0       11   utun0
192.168.202        192.168.12.156     UGSc            0        0   utun0
192.168.203        192.168.12.156     UGSc            0        0   utun0
192.168.247        link#9             UC              1        0  vmnet8