You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Tom Corcoran <To...@trilogycomms.com> on 2006/10/27 15:42:17 UTC

Package prefix with ant build & ClassNotFoundException

I am using IntelliJ and have added a package prefix to my swing project.
If my prefix is "com.mycompany", this means I can have my source in
<src> rather than <src/com/mycompany>. At the moment I can't make the
physical change due to source control issues.

 

An ant build works fine but when I run the applet I get a console
message :
java.lang.ClassNotFoundException MyAppletExtension 
(where MyAppletExtension extends JApplet).

 

I am assuming it can't find the class because of the prefix, but maybe I
am wrong?



The package prefix is contained in a Intellij inc file.  What do I need
to change in the build file (see below) so it can find the classes?

 

Thanks a lot,


Tom.

 

Here's the ant parameters:

<property name="src" location="src"/>
<property name="build" location="classes"/>
<property name="dist" location="jar"/>

with targets :

<target name="compile">
<javac srcdir="${src}" destdir="${build}"/>
</target>

<target name="dist" depends="compile">
<jar jarfile="${dist}/MyApplet.jar" basedir="${build}"/>
</target>



 


Re: Package prefix with ant build & ClassNotFoundException

Posted by Peter Reilly <pe...@gmail.com>.
The package of the class has changed, therefore
the classname has changed from ClassName to package.ClassName,
therefore the applet needs to be changed to
refer to the new classname.

Peter



On 10/30/06, Prashant <pr...@pramati.com> wrote:
> Hi Tom,
>
> If you do not have these problems with the classes that IntelliJ
> generates.....
> then can you not ask IntelliJ to generate a ANT build script to build
> your project ? :)
>
> You could take a look at that generated build script and figure out what
> to do..
>
> -Prashant
>
> Tom Corcoran wrote:
> > I am using IntelliJ and have added a package prefix to my swing project.
> > If my prefix is "com.mycompany", this means I can have my source in
> > <src> rather than <src/com/mycompany>. At the moment I can't make the
> > physical change due to source control issues.
> >
> >
> >
> > An ant build works fine but when I run the applet I get a console
> > message :
> > java.lang.ClassNotFoundException MyAppletExtension
> > (where MyAppletExtension extends JApplet).
> >
> >
> >
> > I am assuming it can't find the class because of the prefix, but maybe I
> > am wrong?
> >
> >
> >
> > The package prefix is contained in a Intellij inc file.  What do I need
> > to change in the build file (see below) so it can find the classes?
> >
> >
> >
> > Thanks a lot,
> >
> >
> > Tom.
> >
> >
> >
> > Here's the ant parameters:
> >
> > <property name="src" location="src"/>
> > <property name="build" location="classes"/>
> > <property name="dist" location="jar"/>
> >
> > with targets :
> >
> > <target name="compile">
> > <javac srcdir="${src}" destdir="${build}"/>
> > </target>
> >
> > <target name="dist" depends="compile">
> > <jar jarfile="${dist}/MyApplet.jar" basedir="${build}"/>
> > </target>
> >
> >
> >
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> 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


Re: Package prefix with ant build & ClassNotFoundException

Posted by Prashant <pr...@pramati.com>.
Hi Tom,

If you do not have these problems with the classes that IntelliJ 
generates.....
then can you not ask IntelliJ to generate a ANT build script to build 
your project ? :)

You could take a look at that generated build script and figure out what 
to do..

-Prashant

Tom Corcoran wrote:
> I am using IntelliJ and have added a package prefix to my swing project.
> If my prefix is "com.mycompany", this means I can have my source in
> <src> rather than <src/com/mycompany>. At the moment I can't make the
> physical change due to source control issues.
>
>  
>
> An ant build works fine but when I run the applet I get a console
> message :
> java.lang.ClassNotFoundException MyAppletExtension 
> (where MyAppletExtension extends JApplet).
>
>  
>
> I am assuming it can't find the class because of the prefix, but maybe I
> am wrong?
>
>
>
> The package prefix is contained in a Intellij inc file.  What do I need
> to change in the build file (see below) so it can find the classes?
>
>  
>
> Thanks a lot,
>
>
> Tom.
>
>  
>
> Here's the ant parameters:
>
> <property name="src" location="src"/>
> <property name="build" location="classes"/>
> <property name="dist" location="jar"/>
>
> with targets :
>
> <target name="compile">
> <javac srcdir="${src}" destdir="${build}"/>
> </target>
>
> <target name="dist" depends="compile">
> <jar jarfile="${dist}/MyApplet.jar" basedir="${build}"/>
> </target>
>
>
>
>  
>
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org