Soy nuevo en Ant
, estoy realizando un programa client-server
con Eclipse
, estoy usando librerías externas: JMapViewer-1.14.1.jar
, el server funciona correctamente el client me lanza un error.
Al ejecutar desde el terminal de Ubuntu
:
ant clean compile jar run
Recibo un error
en el target run
:
[java] Error: A JNI error has occurred, please check your installation and try again
[java] Exception in thread "main" java.lang.NoClassDefFoundError: org/openstreetmap/gui/jmapviewer/JMapViewer
[java] at java.lang.Class.getDeclaredMethods0(Native Method)
[java] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
[java] at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
[java] at java.lang.Class.getMethod0(Class.java:3018)
[java] at java.lang.Class.getMethod(Class.java:1784)
[java] at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
[java] at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
[java] Caused by: java.lang.ClassNotFoundException: org.openstreetmap.gui.jmapviewer.JMapViewer
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] ... 7 more
[java] Java Result: 1
Mi file build.xml:
<project>
<target name="clean">
<delete dir="build" />
</target>
<target name="compile">
<mkdir dir="build/classes" />
<javac includeantruntime="false" srcdir="src" destdir="build/classes">
<classpath>
<pathelement path="/home/bryan/Scrivania/Libraries/JMapViewer-1.14.1.jar" />
<pathelement path="/home/bryan/Scrivania/Libraries/mail.jar" />
<pathelement path="/home/bryan/Scrivania/Libraries/postgresql-42.0.0.jre6.jar" />
</classpath>
</javac>
</target>
<target name="jar">
<mkdir dir="build/jar" />
<jar destfile="build/jar/UI.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="UI" />
</manifest>
</jar>
</target>
<target name="run">
<java jar="build/jar/UI.jar" fork="true" />
</target>
</project>