Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts

Wednesday, February 7, 2018

Start Your Spring development with IntelliJ IDEA in 3 Minutes


Lots of my students and juniors keep telling me that, setting up a “Spring” development environment is a big hassle. There are many tutorials are available in the web but they are not comfortable with those. May be the tools we are using are slightly different with them or it is just a time consuming for the initial setting up. That is why I choose to write a post them to start a spring project from scratch, hopefully it will help others too. I am using “IntelliJ IDEA” ultimate IDE (as usual) and maven for build automation tool. I will deploy it on JBoss server (similar on Apache Tomcat or Oracle WebLogic).
  
You will find lots of good tutorials on downloading and setting up IDE (Idea) and web-server (JBoss) and the basic knowledge on Spring MVC, so I am omitting those things (if you don’t find it on Google, make a comments on the below comment section).

    Please follow steps by steps –
1)    Go to  New Project -> Maven , don’t select archetype and press Next

2)    Write GroupId, ArtifactId, Version like this.


groupId will identify your project uniquely across all projects, so we need to enforce a naming schema. It has to follow the package name rules, what means that has to be at least as a domain name you control, and you can create as many subgroups as you want. Example-
com.roni

artifactId is the name of the jar without version. If you created it then you can choose whatever name you want with lowercase letters and no strange symbols. If it's a third party jar you have to take the name of the jar as it's distributed. Example-
springtest

version if you distribute it then you can choose any typical version with numbers and dots (1.0, 1.1, 1.0.1, ...). In this example, we will keep the default-
1.0-SNAPSHOT

3)    Press Next then write the Project Name and select the project location, then click Finish  



4)    Open the maven pom.xml file (if not opened yet automatically) and add the following lines inside the project tag.-
<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <packaging>war</packaging>

    <properties>
        <spring.version>4.3.0.RELEASE</spring.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
    </dependencies>


You can choose enable auto import option or you have to click import changes whenever you have made any change on the pom.xml


5)    Create webapp and WEB-INF directory in the main folder as shown below –


6)    Create web.xml file in WEB-INF and write the following lines-

<?xml version="1.0" encoding="ISO-8859-1" ?>

<web-app id="WebApp_ID" version="2.4"
         xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

    <display-name>Spring Test Application</display-name>
    <description>
        This is a simple spring mvc app
    </description>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/dispatcher-servlet.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

</web-app>


   

7)    Now create dispatcher-servlet.xml file on WEB-INF directory and add the following lines on it


   
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
    <mvc:annotation-driven/>
    <context:component-scan base-package="com.roni.springtest.controllers"/>

    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/views/"/>
        <property name="suffix" value=".jsp"/>
    </bean>
</beans>




Here base-package is your java package, which we will going to create on the next steps.


8)    Now create the package and a new Controller class SpringTestController in it. Write the following codes –

package com.roni.springtest.controllers;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * User: Towhidul Haque Roni
 * Date: 2/7/2018
 * Time: 2:39 PM
 */
@Controller
public class SpringTestController {

    @GetMapping("/")
    public String index(Model m) {
        m.addAttribute("aVariable", "Hello World");
        return "index";
    }
}




9)    Create directory views in WEB-INF and create index.jsp file on it. Write the following lines on it-
<!DOCTYPE html>
<html>
<body>

    <h1>Spring MVC Test</h1>

    <p>${aVariable}</p>

</body>
</html>

10)    Now if you click Run from Run menu for the first time, you will be prompt to Edit Configuration. If you click, following menu will  appear –


11)    Click the top most left + sing, then scroll down and you will see the JBoss Server. Select the local, If you have already configured the JBoss server it will appear in the application server dropdown list, if not then click Configure and it will require to show the JBoss home directory. I have downloaded the jboss-eap-7.1.0 and unzip it and showed the path ( jboss-eap-7.1.0\jboss-eap-7.1 ) as a home directory.

12)    Then go to Deployment , click the right most + sign and add springtest.war artifacts like below  -




13)    Now click Run, hopefully you will be able to see the output like below –


Enjoy!!! I hope that it will save your time. On the upcoming post, I will do REST web service and spring data within 5 minutes setting up time.

Monday, September 10, 2012

Intellij Idea key scheme for Eclipse



I’m a diehard fan of intellij idea. I also developed few android apps on idea. Just missing the UI drag and drop option but it will come in the version 12.  Already preview option is available from version 11. There are some projects on going in my office and I have to use eclipse, so I have to know the shortcut of eclipse. But suddenly I found an idea key scheme for eclipse.  Download the latest jar from the following URL –
Then put the jar on “plugins” directory of the eclipse and restart the eclipse IDE.
Now you will see idea schema on Keys (Window->Preferences->General->Keys).
Thanks to Santhosh to make our life easy :)

Sunday, May 8, 2011

Making jar by IntelliJ IDEA

Few people told me why are you using idea, it is not possible to create jar from it. Actually this idea about idea is totally wrong. To make a jar from idea go to

File -> Project Structure -> Artifacts

Then click the plus sign to add a jar setting. The “Create Jar from Modules” window will appear. Select the module and main class.

1) Choose extract to the target jar to include all the library jars include in your jar. Then press Apply and Ok. After than you will see a “Build ‘moduleName.jar:’ artifact” option in Build menu. It’s simple.

Or

2) And if you choose “copy to output directory and link via manifest” the edit the manifest to locate the library jars in Class-Path tag ex-(lib/one.jar lib/two.jar). Remind that if you execute the jar from a folder which folder is located in the project root directory and your library jars are located on a “lib” folder which is also in the root project directory, then add class path like (Class-Path: ../lib/one.jar ../lib/two.jar)

Thursday, January 14, 2010

Make IDEA faster

I was working on a renowned XYZ software company. They prefer IntelliJ IDEA as a IDE. My senor collogue give me some task and I was working on the IDEA. He found the IDE is too slow and suggest me to increase the virtual memory. So I have change it in the “idea.vmoptions” file located on (/idea/bin).
======================================
-Xms700m
-Xmx1024m
-XX:MaxPermSize=450m
-ea
=====================================
But it seems too slow for scrolling the codes on IDEA. Then my senior suggests me to use version 6 instead of version 8. But I was working with IDEA 8 and looking for a solution. Suddenly senior bro came to me and wanted to see my progress. When he found IDEA version 8 he became angry and warn me he will delete all my code. I was so scared though I have IDEA local history and git ;) . Then I suddenly found the solution that it frequently uses graphics card but I know that it is not NFS(my favorite game :P) so I can disable that by including
-Dsun.java2d.pmoffscreen=false
At the end of the “idea.vmoptions” file. And the problem solved :D

Saturday, October 10, 2009

How to install Java and Tomcat on Linux

[towhid@roni ~]$ wget http://www.java.net/download/jdk6/6u10/promoted/b32/binaries/jre-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin

--05:00:10-- http://www.java.net/download/jdk6/6u10/promoted/b32/binaries/jre-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin

Resolving www.java.net... 64.125.132.37, 64.125.132.39

Connecting to www.java.net|64.125.132.37|:80... connected.

HTTP request sent, awaiting response... 301 Moved Permanently

Location: http://download.java.net/jdk6/6u10/promoted/b32/binaries/jre-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin [following]

--05:00:10-- http://download.java.net/jdk6/6u10/promoted/b32/binaries/jre-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin

Resolving download.java.net... 72.5.124.114

Connecting to download.java.net|72.5.124.114|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 20034708 (19M) [application/octet-stream]

Saving to: `jre-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin'

100%[=======================================>] 20,034,708 686K/s in 42s

05:00:53 (462 KB/s) - `jre-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin' saved [20034708/20034708]

[towhid@roni ~]$ chmod u+x jre-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin

[towhid@roni ~]$ ./jre-6u10-rc2-bin-b32-linux-i586-12_sep_2008.bin

........................................................

plication-x-java-jnlp-file.png

creating: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/

creating: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/apps/

inflating: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/apps/sun-java.png

inflating: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png

inflating: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/apps/sun-jcontrol.png

creating: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/mimetypes/

extracting: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/mimetypes/gnome-mime-text-x-java.png

extracting: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/mimetypes/gnome-mime-application-x-java-archive.png

extracting: jre1.6.0_10/lib/desktop/icons/hicolor/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png

creating: jre1.6.0_10/lib/desktop/icons/HighContrast/

creating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/

creating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/apps/

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/apps/sun-java.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/apps/sun-javaws.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/apps/sun-jcontrol.png

creating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/mimetypes/

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/mimetypes/gnome-mime-text-x-java.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/mimetypes/gnome-mime-application-x-java-archive.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/16x16/mimetypes/gnome-mime-application-x-java-jnlp-file.png

creating: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/

creating: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/apps/

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/apps/sun-java.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/apps/sun-javaws.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/apps/sun-jcontrol.png

creating: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/mimetypes/

extracting: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/mimetypes/gnome-mime-text-x-java.png

extracting: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/mimetypes/gnome-mime-application-x-java-archive.png

extracting: jre1.6.0_10/lib/desktop/icons/HighContrast/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png

creating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/

creating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/

creating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/apps/

inflating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/apps/sun-java.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/apps/sun-javaws.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/apps/sun-jcontrol.png

creating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/mimetypes/

extracting: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/mimetypes/gnome-mime-text-x-java.png

extracting: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/mimetypes/gnome-mime-application-x-java-archive.png

extracting: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/16x16/mimetypes/gnome-mime-application-x-java-jnlp-file.png

creating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/

creating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/apps/

inflating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/apps/sun-java.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/apps/sun-javaws.png

inflating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/apps/sun-jcontrol.png

creating: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/mimetypes/

extracting: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/mimetypes/gnome-mime-text-x-java.png

extracting: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/mimetypes/gnome-mime-application-x-java-archive.png

extracting: jre1.6.0_10/lib/desktop/icons/HighContrastInverse/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png

creating: jre1.6.0_10/lib/desktop/icons/LowContrast/

creating: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/

creating: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/apps/

extracting: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/apps/sun-java.png

extracting: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/apps/sun-javaws.png

extracting: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/apps/sun-jcontrol.png

creating: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/mimetypes/

extracting: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/mimetypes/gnome-mime-text-x-java.png

extracting: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/mimetypes/gnome-mime-application-x-java-archive.png

extracting: jre1.6.0_10/lib/desktop/icons/LowContrast/16x16/mimetypes/gnome-mime-application-x-java-jnlp-file.png

creating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/

creating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/apps/

inflating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/apps/sun-java.png

inflating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/apps/sun-javaws.png

inflating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/apps/sun-jcontrol.png

creating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/mimetypes/

inflating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/mimetypes/gnome-mime-text-x-java.png

inflating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/mimetypes/gnome-mime-application-x-java-archive.png

inflating: jre1.6.0_10/lib/desktop/icons/LowContrast/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png

creating: jre1.6.0_10/lib/desktop/applications/

inflating: jre1.6.0_10/lib/desktop/applications/sun-java.desktop

inflating: jre1.6.0_10/lib/desktop/applications/sun-javaws.desktop

inflating: jre1.6.0_10/lib/desktop/applications/sun_java.desktop

creating: jre1.6.0_10/lib/desktop/mime/

creating: jre1.6.0_10/lib/desktop/mime/packages/

inflating: jre1.6.0_10/lib/desktop/mime/packages/x-java-archive.xml

inflating: jre1.6.0_10/lib/desktop/mime/packages/x-java-jnlp-file.xml

creating: jre1.6.0_10/lib/locale/

creating: jre1.6.0_10/lib/locale/de/

creating: jre1.6.0_10/lib/locale/de/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/de/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/es/

creating: jre1.6.0_10/lib/locale/es/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/es/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/fr/

creating: jre1.6.0_10/lib/locale/fr/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/fr/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/it/

creating: jre1.6.0_10/lib/locale/it/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/it/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/ja/

creating: jre1.6.0_10/lib/locale/ja/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/ja/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/ko/

creating: jre1.6.0_10/lib/locale/ko/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/ko/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/ko.UTF-8/

creating: jre1.6.0_10/lib/locale/ko.UTF-8/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/ko.UTF-8/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/sv/

creating: jre1.6.0_10/lib/locale/sv/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/sv/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/zh/

creating: jre1.6.0_10/lib/locale/zh/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/zh/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/zh.GBK/

creating: jre1.6.0_10/lib/locale/zh.GBK/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/zh.GBK/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/zh_TW/

creating: jre1.6.0_10/lib/locale/zh_TW/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/zh_TW/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/zh_TW.BIG5/

creating: jre1.6.0_10/lib/locale/zh_TW.BIG5/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/zh_TW.BIG5/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/locale/zh_HK.BIG5HK/

creating: jre1.6.0_10/lib/locale/zh_HK.BIG5HK/LC_MESSAGES/

inflating: jre1.6.0_10/lib/locale/zh_HK.BIG5HK/LC_MESSAGES/sunw_java_plugin.mo

creating: jre1.6.0_10/lib/deploy/

inflating: jre1.6.0_10/lib/deploy/ffjcext.zip

inflating: jre1.6.0_10/lib/deploy/splash.gif

inflating: jre1.6.0_10/lib/deploy/messages.properties

inflating: jre1.6.0_10/lib/deploy/messages_zh_TW.properties

inflating: jre1.6.0_10/lib/deploy/messages_de.properties

inflating: jre1.6.0_10/lib/deploy/messages_es.properties

inflating: jre1.6.0_10/lib/deploy/messages_fr.properties

inflating: jre1.6.0_10/lib/deploy/messages_it.properties

inflating: jre1.6.0_10/lib/deploy/messages_ja.properties

inflating: jre1.6.0_10/lib/deploy/messages_ko.properties

inflating: jre1.6.0_10/lib/deploy/messages_sv.properties

inflating: jre1.6.0_10/lib/deploy/messages_zh_CN.properties

inflating: jre1.6.0_10/lib/deploy/messages_zh_HK.properties

inflating: jre1.6.0_10/lib/deploy/java-icon.ico

inflating: jre1.6.0_10/lib/javaws.pack

inflating: jre1.6.0_10/lib/deploy.pack

inflating: jre1.6.0_10/lib/jsse.pack

inflating: jre1.6.0_10/lib/charsets.pack

inflating: jre1.6.0_10/COPYRIGHT

inflating: jre1.6.0_10/Welcome.html

inflating: jre1.6.0_10/README

inflating: jre1.6.0_10/LICENSE

creating: jre1.6.0_10/man/

creating: jre1.6.0_10/man/man1/

inflating: jre1.6.0_10/man/man1/java.1

inflating: jre1.6.0_10/man/man1/keytool.1

inflating: jre1.6.0_10/man/man1/rmid.1

inflating: jre1.6.0_10/man/man1/rmiregistry.1

inflating: jre1.6.0_10/man/man1/tnameserv.1

inflating: jre1.6.0_10/man/man1/servertool.1

inflating: jre1.6.0_10/man/man1/orbd.1

inflating: jre1.6.0_10/man/man1/policytool.1

inflating: jre1.6.0_10/man/man1/pack200.1

inflating: jre1.6.0_10/man/man1/unpack200.1

inflating: jre1.6.0_10/man/man1/javaws.1

linking: jre1.6.0_10/man/ja -> ja_JP.eucJP

creating: jre1.6.0_10/man/ja_JP.eucJP/

creating: jre1.6.0_10/man/ja_JP.eucJP/man1/

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/java.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/keytool.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/rmid.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/rmiregistry.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/tnameserv.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/servertool.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/orbd.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/policytool.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/pack200.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/unpack200.1

inflating: jre1.6.0_10/man/ja_JP.eucJP/man1/javaws.1

creating: jre1.6.0_10/plugin/

creating: jre1.6.0_10/plugin/i386/

creating: jre1.6.0_10/plugin/i386/ns7/

inflating: jre1.6.0_10/plugin/i386/ns7/libjavaplugin_oji.so

creating: jre1.6.0_10/plugin/i386/ns7-gcc29/

inflating: jre1.6.0_10/plugin/i386/ns7-gcc29/libjavaplugin_oji.so

creating: jre1.6.0_10/plugin/desktop/

extracting: jre1.6.0_10/plugin/desktop/sun_java.png

inflating: jre1.6.0_10/plugin/desktop/sun_java.desktop

creating: jre1.6.0_10/javaws/

linking: jre1.6.0_10/javaws/javaws -> ../bin/javaws

Creating jre1.6.0_10/lib/rt.jar

Creating jre1.6.0_10/lib/jsse.jar

Creating jre1.6.0_10/lib/charsets.jar

Creating jre1.6.0_10/lib/ext/localedata.jar

Creating jre1.6.0_10/lib/plugin.jar

Creating jre1.6.0_10/lib/javaws.jar

Creating jre1.6.0_10/lib/deploy.jar

Done.

[towhid@roni ~]$ su

Password:******

[root@roni towhid]# mv jre1.6.0_10 /usr/lib/

[root@roni towhid]# echo "export JAVA_HOME=/usr/lib/jre" >> ~/.bashrc

[root@roni towhid]# echo "export PATH=$JAVA_HOME/bin:$PATH" >> ~/.bashrc

[root@roni towhid]# wget http://download.nextag.com/apache/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.tar.gz

--05:10:40-- http://download.nextag.com/apache/tomcat/tomcat-5/v5.5.27/bin/apache-tomcat-5.5.27.tar.gz

Resolving download.nextag.com... 216.185.208.5

Connecting to download.nextag.com|216.185.208.5|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 6478912 (6.2M) [application/x-gzip]

Saving to: `apache-tomcat-5.5.27.tar.gz'

100%[=======================================>] 6,478,912 1.25M/s in 5.3s

05:10:46 (1.15 MB/s) - `apache-tomcat-5.5.27.tar.gz' saved [6478912/6478912]

[root@roni towhid]# tar -xzf apache-tomcat-5.5.27.tar.gz

[root@roni towhid]# mv apache-tomcat-5.5.27 /opt/tomcat-5.5

[root@roni towhid]# echo "export CATALINA_HOME=/opt/tomcat-5.5" >> ~/.bashrc

[root@roni towhid]# echo "CATALINA_BASE=/opt/tomcat-5.5" >> ~/.bashrc

@decorators in Python

People have confusion about how to use python decorators in the proper way and how it works. The main reason for it is there are several way...