How to create an executable jar with 3rd party dependencies included in the jar

If you have written a small java utility that has dependencies on other 3rd party jar and you would like other people to use it without building your jar, you will need to include those jars in your jar. To do this you need to use the maven-assembly-plugin .

So inside <build> ... <plugins>  of your pom.xml put

<plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
        <archive>
          <manifest>
            <mainClass>your.fully.qualified.MainClass</mainClass>
          </manifest>
        </archive>
        <descriptorRefs>
          <descriptorRef>jar-with-dependencies</descriptorRef>
        </descriptorRefs>
      </configuration>
</plugin>

Then run maven using :  mvn clean compile assembly:single

How to install VNC on Redhat and avoid getting "font catalog is not properly configured" error

 yum install -y  tigervnc-server tigervnc-server-module libXfont pixman xterm xorg-x11-twm

Setting YUM proxy settings in Redhat

If you are behind a proxy YUM won't be able to connect to its repositories. To fix this you will need to add your proxy setting to /etc/yum.conf

If you are using an anonymous proxy, only the following line needs to get added to yum.conf

proxy=http://<poxy-server>:<proxy-port>/

In case your proxy server requires authentication also add the following lines in addtion to the above

proxy_username=<proxy-user>
proxy_password=<proxy-password>