Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » how to compile and run outside of eclipse
how to compile and run outside of eclipse [message #256384] Wed, 14 May 2008 19:57
Eclipse UserFriend
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>
Previous Topic:classpath not working ...
Next Topic:Generate Eclipse makefiles from command line
Goto Forum:
  


Current Time: Sun Jul 21 13:40:19 GMT 2024

Powered by FUDForum. Page generated in 0.11055 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top