This section contains tutorials that describe how to install and setup some software packages.
This tutorial has been written mainly as a result of some trouble we had in our practise at TUD when we had to set up Apache Tomcat for the project. It describes how to install and set up the Java Development Kit, Apache Tomcat and Eclipse.
Table of Contents
Apache Tomcat needs the Java Developent Environment installed on your machine. Depending on the Tomcat version you plan to use, you maybe need different versions of the JDK. The newest version of Tomcat (6.0) needs the JDK 1.6. You can download the JDK 6 e.g. from here.
Note:
Do not mix up the Java Runtime Environment (JRE) and the Java Development Kit (JDK)! Tomcat will need the latter! You do not need to download the JRE separately, as it is included in the JDK.
Afterwards, you are advised to create a new environment variable JAVA_HOME that points to the directory where you installed the JDK (on Windows this is mostly C:\program files\Java\jdk-x\. Also add the path to the JDK's "bin" directory to your PATH environment variable!
To check whether you setup everything correctly, open a terminal window and type
Next, you can download Apache Tomcat. Go to their Website and download your preferred version of Tomcat. The current version of 6.0, which needs the JDK 6 we just installed. If you download an older version, you will probably need also an older version of Java installed!
Do download the zip or tar.gz version and unpack it. Then, enter the directory and go to the conf directory. There you'll find several xml files, where Tomcat's settings are stored. The default settings are pretty good, however, you can change them if needed (e.g. you might prefer to change Tomcats default port to 80 instead of 8080).
Eclipse is a pretty cool IDE that really supports a developer. Thus, it also enables you to run a web application directly in the IDE!
But first:
Go to the Eclipse Download page and download Eclipse for Java Developers. Select your operating system there and you'll end up with an archive file you just have to unpack to an location of your choice. Enter the eclipse directory and start the executable you'll find there.
Create or import a Web application. Then you can start it via Run as and start it on a server. Then you should see a window where you will find a list that also contains several versions of Tomcat. Select a version there. Then you will also have to set the path where Tomcat is installed. Afterwards, simply click Finish and Eclipse should start the web application directly in the IDE.
If you have included a 3rd Party Java Library in your Eclipse project you maybe already noticed, that you don't get that neat and sometimes really useful context help when hovering e.g. a class name from that archive. However, it is possible to add this feature for the archive, too.
After you added the Jar to your project, it should be visible in Java Resources ยป Libraries. There, right click it and select Properties.
Now, go to Javadoc Location. You will end up in a new tab, where you can set up the Javadoc location for that Jar. You currently can select to either give an URL to a valid Javadoc location (you can enter both online and offline paths here, e.g. http:// or file:/), or to specify an archive file containing the documentation.
After you finished, hit Apply and enjoy programming ;)
The Project Explorer integrated in Eclipse IDE is a really nice feature. However, when working with a lot with packages, you may need to tweak it a bit...
By default, the explorer shows packages in a flat view. This is because some projects use to use names as org.eclipse.XXX and so on. For these a flat view is quit perfect.
However, if you use packages to structure your own projects hierarchical, you might want to have a tree view like display, as it heavily shortens the length of the list of items that are displayed at once.
To change the display mode, click onto the little arrow-down symbol in the Project Explorer (should be in it's titlebar on the right side). There, go to Package Presentation. Now you can select between the flat and the structured ("Hierarchical") view modes.
Usually, you log in via SSH using your remote user name and password. However, you does not need necessarily.
You can also log in by using a so called fingerprint. So, don't let us wast a lot time; here is what you need to do:
First, generate a local key pair:
Now we are really close: Log in on the remote server and add the fingerprint to the list of authorized keys:
That's it! If you try to connect to the remote server the next time, you will no longer need to provide your password.
A lot of keyboards today come with a bunch of multimedia keys. On laptops on the other side you often have a Fn key used to activate a further function of a given key. The xbindkeys tool gives you the possibility to bind these keys to your preferred actions!
First, you probably have to install the xbindkeys utility, as it isn't installed by default as far as I know. However, it should be included in most distros repositories, so you can just use your distribution specific tool to install it, e.g. in Fedora type:
Next, you should create a personal configuration file. The xbindkeys command can create a default one for you, too:
OK. Now open the newly created file with your editor of choice. The file has a pretty easy to understand syntax:
Next, we have to find out the key codes. E.g. on a usual laptop, the key combinations Fn + F11 and Fn + F12 are used to decrease/increase volume. To bind these two events to an action, we use xbindkeys to figure out their codes:
Now, a small window should pop up. You can now press some key combinations (also with Ctrl, Alt and Meta modifiers). In my case, I use Fn + F11 and (in the second iteration) Fn + F12, which results in these output:
Now we can insert the key codes together with the actions in the configuration file, by just appending this to it:
Now... a last step to do:
We have to start xbindkeys daemon! This can be done by simply calling:
From now on, pressing Fn+F11 or Fn+F12 should change your volume! To autostart the xbindkeys daemon, you should put a script in your personal autostart folder (e.g. $HOME/.kde/env/ when you use KDE or $HOME/.config/autostart/.) The script can look like this:
That's it! Have a lot of fun!