Exception in thread "main" java.lang.NoClassDefFoundError while using JavaFX Application Thread

I had tested my program through Eclipse, but when deploying it on a Windows system using cmd, i am getting some sort of classpath error for JavaFX application thread.

Exception

Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
        at com.th.app.ui.Login.<clinit>(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplicationWithArgs$2(LauncherImpl.java:352)
        at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
        at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
        at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
        at com.sun.glass.ui.win.WinApplication.lambda$null$4(WinApplication.java:185)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 12 more
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.NullPointerException
        at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:383)
        at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
        ... 5 more

I am using the same system, hence not sure, what is the reference i am missing. The only difference is it is running from the IDE but not from the cmd prompt as-is.


JavaFX - build.xml:

<?xml version="1.0"?>
<project name="App" default="all" basedir=".">
    <property name="src"   value="./src"/>
    <property name="build" value="./build"/>
    <property name="lib"   value="./lib"/>
    <property name="dest"   value="./dest"/>
    <property name="main-class"  value="com.th.app.ui.Login"/>

    <path id="classpath">
        <fileset dir="${lib}" includes="**/*.jar"/>
    </path>

    <target name="all" depends="clean, compile, jar, copy-file" description="Builds the whole project">
        <echo>Doing all</echo>
    </target>

    <target name="clean" description="Removes previous build">
        <delete verbose="true">
            <fileset dir="${build}"/>
        </delete>
    </target>

    <target name="compile" depends="clean" description="compile whole project">
        <echo>compile ${ant.project.name} </echo>
        <mkdir dir="${build}/classes"/>
        <copy file="./config.properties" tofile="${build}/classes/config.properties"/>
        <copy file="./src/log4j.properties" tofile="${build}/classes/log4j.properties"/>
        <copy todir="${build}/classes/com/th/app/ui">
           <fileset dir="${src}/com/th/app/ui">
                   <include name="**/*.fxml"/>
                   <include name="**/*.css"/>
           </fileset>
        </copy>

        <javac srcdir="${src}" destdir="${build}/classes" classpathref="classpath" includeantruntime="false" />
    </target>

    <target name="jar" depends="compile">
        <mkdir dir="${build}/jar"/>
        <jar destfile="${build}/jar/${ant.project.name}.jar" basedir="${build}/classes">
            <manifest>
                <attribute name="Main-Class" value="${main-class}"/>
            </manifest>
        </jar>
    </target>

    <property name="args" value="READWRITE"/>
    <target name="run" depends="copy-file, input-runargs">
        <java fork="true" classname="${main-class}">
            <classpath>
                <path refid="classpath"/>
                <path location="${dest}/jar/${ant.project.name}.jar"/>
            </classpath>
            <arg line="${args}"/>
        </java>
    </target>
    <target name="input-runargs" unless="args" description="prompts for command line arguments if necessary">
       <input addProperty="args" message="Type the desired command line arguments:"/>
    </target>

    <target name="copy-file">
        <copy todir="${dest}"><fileset dir="${build}"/></copy>
    </target>

</project>