ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rafael Barrera Oro" <boraf...@gmail.com>
Subject Re: Ant and Swing
Date Wed, 06 Jun 2007 16:58:58 GMT
Not solved yet :(

It seems that the problem had to do with permissions, i have to grant Ant
the permission java.lang.RuntimePermission exitVM, which is the correct way
of doing this?

i tried the following and did not work (NoClassDefFoundError, i assume that
the RuntimePermission cant be found even when the classpath has been
defined)

<target name="ejecutar (Consola)" depends="compilar" description="ejecuta el
proyecto">
<java failonerror="true" classname="
ar.com.grupo.algo3.programandconquer.test.Test">
<permissions>
<grant name="exitVM" class="java.lang.RuntimePermission"/>
</permissions>
<classpath>
<pathelement path="${build}"/>
<pathelement path="${java.class.path}"/>
</classpath>
</java>
</target>

Thanks in advance, again



2007/6/6, Rafael Barrera Oro <borafael@gmail.com>:
> Indeed, i searched elsewhere and found the problem, it has nothing to
> do with the Ant script, thanks very much, i was convinced it was an
> Ant Issue.
>
> 2007/6/6, Jan.Materne@rzf.fin-nrw.de <Jan.Materne@rzf.fin-nrw.de>:
> > I think your application just terminates very early.
> > This works for me:
> >
> > <project default="all">
> >     <property name="dir" value="tmp"/>
> >
> >     <target name="all" depends="clean,createJava,build,run"/>
> >
> >     <target name="clean">
> >         <delete dir="${dir}"/>
> >     </target>
> >
> >     <target name="createJava">
> >         <mkdir dir="${dir}"/>
> >         <concat destfile="${dir}/Main.java">
> >             import javax.swing.JFrame;
> >             public class Main {
> >                 public static void main(String[] args) {
> >                     JFrame   f = new JFrame("Hello from Ant");
> >                     f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
> >                     f.setSize(300, 200);
> >                     f.setVisible(true);
> >                 }
> >             }
> >         </concat>
> >     </target>
> >
> >     <target name="build">
> >         <javac srcdir="${dir}" destdir="${dir}"/>
> >     </target>
> >
> >     <target name="run">
> >         <java classname="Main" classpath="${dir}" fork="true"/>
> >     </target>
> >
> > </project>
> >
> >
> >
> > Jan
> >
> > >-----Urspr√ľngliche Nachricht-----
> > >Von: Rafael Barrera Oro [mailto:borafael@gmail.com]
> > >Gesendet: Mittwoch, 6. Juni 2007 16:44
> > >An: user@ant.apache.org
> > >Betreff: Ant and Swing
> > >
> > >How can i manage to execute a project where i use Swing ? i tried
> > >doing it normally but it does not work (without throwing an exception,
> > >it simply concludes the task without executing the Swing portion of my
> > >project).
> > >
> > >Thanks in advance
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > >For additional commands, e-mail: user-help@ant.apache.org
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message