how to compile and run outside of eclipse [message #256384] |
Wed, 14 May 2008 19:57 |
Eclipse User |
|
|
|
Originally posted by: leknarf.pacbell.net
How does one compile and launch an app from the outside of Eclipse? Which
libs are necessary to include in a build.xml file. Is there a reference
for which libs are necessary for to build for different platforms? Where
should these includes reside? Copied to a subdir of each project dir?
I'm using a simple Ant build.xml file that I can Run As... from within
Eclipse. Doing so results in a compile and run without error.
When I try to compile using Ant from the cmd-line, I get numerous errors
that seem to indicate it can't find swt jarfiles. eg:
package org.eclipse.swt does not exist
[ ... ]
When I try to run the app from the cmd-line, I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError:
Though nothing follows the ":" at the end of the msg.
Note that I'm following the instructions on
http://www.eclipse.org/swt/macosx/ for deploying on OSX.
I'm still quite new to Eclipse, SWT, Java, Ant, &c. Thanks in advance!
Scott
[ build.xml ]
<?xml version = "1.0" encoding="UTF-8" ?>
<project name = "HelloSWTWorld" default = "Main Build" basedir=".">
<property name="bin" location="bin/"/>
<property name="src" location="src/"/>
<property name="jardir" location="${bin}/lib"/>
<property name="jarfile" location="${jardir}/HellowSWTWorld" />
<!-- <property name="build.compiler" -->
<!--value="org.eclipse.jdt.core.JDTCompilerAdapter" /> -->
<target name = "Main Build" depends="Initialize, Compile, Jar">
<echo message = "Ant at work" />
</target>
<target name="Initialize">
<delete dir="${bin}"/>
<delete dir="${jardir}"/>
<mkdir dir="${bin}"/>
<mkdir dir="${jardir}"/>
</target>
<target name="Compile" depends="Initialize">
<javac srcdir="${src}"
destdir="${bin}">
</javac>
</target>
<target name="Jar" depends="Initialize, Compile">
<jar destfile="${jarfile}" basedir="${bin}"/>
</target>
</project>
|
|
|
Powered by
FUDForum. Page generated in 0.09055 seconds