Question: In Eclipse, there is an option Export -> JAR File. Then we select desirable classes which want to export to output jar.

How can we do that in IntelliJ?

Answer: 
I don't know if you need this answer anymore, but I had the same issue today and I figured out how to solve it.
Please, follow these steps:

1. File -> Project Structure (Ctrl + Alt + Shift + S);
2. Go to the "Artifacts" Menu -> click on the "+" button -> JAR -> From modules with dependencies...
3. Select the module you want to generate the Jar file;
4. Don't select any main class;
5. On the JAR files from libraries menu, select "extract to the target JAR" option -> Click Ok;
6. Name your jar file -> select the output directory -> Click "Apply" and "Ok";
7. After these steps, go to: Build -> Build Artifacts...
8. A flying menu will appear with the artifact that you have previously created;
9. Click Build and it's done.

Hope that that helps you and everyone that have this issue.
I wasted all day trying generate the jar file on Eclipse with FatJar and I couldn't generate it.
You can use Ant to do that.

1. Create your Ant project.
2. Drag and drop ant file to Ant Build view.
3. Execute the task to generate the .jar file.

[![ IntelliJ Ant Build view](https://i.stack.imgur.com/MyNEw.png)](https://i.stack.imgur.com/MyNEw.png)

```
<?xml version="1.0" encoding="utf-8"?>
<project name="CustomJar" default="dist" basedir=".">
    <description>
        Package clases selected package to jar.
    </description>
    <!-- set global properties for this build. **** The paths are relative to the ant file location *** -->
    <property name="src" location="../src/main/java/com/dto/myclasespackage"/>
    <property name="build" location="../build"/>
    <property name="dist" location="../dist/custom_jar"/>
    <property name="version" value="1.0"/>

    <target name="init">
        <!-- Create the time stamp -->
        <tstamp/>
        <!-- Create the build directory defined above -->
        <mkdir dir="${build}"/>
    </target>

    <target name="compile" depends="init" description="compile the source">
        <!-- Compile java code from ${src} into ${build} -->
        <javac srcdir="${src}" destdir="${build}"/>
    </target>

    <target name="dist" depends="compile" description="generate the distribution">
        <buildnumber/>
        <!-- Create the distribution directory -->
        <mkdir dir="${dist}/lib"/>

        <!-- Put everything in ${build} into the MyApplication-${version}.${build.number}.jar -->
        <jar destfile="${dist}/lib/desglose-reports-beans-${version}.${build.number}.jar" basedir="${build}"/>
    </target>

    <target name="clean" description="clean up">
        <!-- Delete the ${build} and ${dist} directories -->
        <delete dir="${build}"/>
        <delete dir="${dist}"/>
    </target>
</project>

```