Posts

Showing posts from May, 2014

Connect via SSH without a password from MacOS to Linux with an SSHKEY

Don't panic , it is really easy. Your Steps will be: 1. Create a key on your Mac 2. Define your key on remote Linux 3. Connect via ssh. 1.  Create the key on your Mac Open the terminal :) First make a directory named .ssh on your home directory ( mkdir .ssh ) If it exist , no problem. Go to the newly created .ssh directory with command cd .ssh Then, you need to create a ssh key on your MAC. There will be 2 files for key. If you dont want any passwords , just press enter when passphrase asked. Filename will be default id_rsa if you just hit enter. But if it already exists , you may want to choose another name. Hakos-MacBook-Pro:.ssh hakan$ ssh-keygen -t rsa -C "your@email.com" Generating public/private rsa key pair. Enter file in which to save the key (/Users/hako/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /Users/hako/.ssh/id_rsa. Your public key has been saved in /

ClassNotFoundException in java

java.lang.ClassNotFoundException occurs when your JVM can not find a required class within your application. The most common cause of this exception is missing required jar's in your project. If you got this exception in Eclipse you should check your project settings. (Right click on your project , choose BuildPath and Configure BuildPath. Find Libraries tab and add required jars or libraries which are bunch of jars) If you got this exception in command line first be sure to run your your class in correct directory. For example you have a test.Tester class. Since each package is in a folder, you run your class in upper directory of the test in command prompt. If your class file is : /usr/home/youruser/test/Tester.class then you should run : $cd /usr/home/youruser $java test.Tester If you use some jars or some other class files from other places , check your classpath. You can fix this in 2 ways. 1. You can add your jars folder to CLASSPATH environment variable of you