Meaningless Drivel is fun!*
The moose likes IDEs, Version Control and other tools and the fly likes Problem build.xml and Ant : Don't find the class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Problem build.xml and Ant : Don Watch "Problem build.xml and Ant : Don New topic
Author

Problem build.xml and Ant : Don't find the class

Aymen Rebouh
Greenhorn

Joined: May 29, 2013
Posts: 7
Hello , I have a problem in my build.xml which doesn't find the main class :



galaxy is the name of my package
Univers.java my main and only class

My ant version : Apache Ant(TM) version 1.8.2 compiled on June 20 2012

So i position myself in the Tp1FormeJava and launch " ant " , and this is the error :



This is ma build.xml :




I'm hoping you will helping me

Edit : I changed galaxy/Univers by galaxy.Univers
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

Make sure that this file exists: ./Class/galaxy/Univers.class (starting from your basedir where build.xml is located)

I don't use a Mac, so I have no idea what the Finder screenshot is telling me (I'm not even sure that is from a Mac, I'm only guessing) - exactly what directory are the displayed Univers.class and Univers.java files located? I would have expected them to be located at
/Users/rebouhaymen/Desktop/Aymen/IUT/Java/Tp1FormeJava/Src/galaxy/Univers.java
and
/Users/rebouhaymen/Desktop/Aymen/IUT/Java/Tp1FormeJava/Class/galaxy/Univers.class
respectively.

By the way, what is the package declaration within Univers.java? I am assuming it is "package galaxy;" based on the definition of MainClass in the build.xml.


JBoss In Action
Aymen Rebouh
Greenhorn

Joined: May 29, 2013
Posts: 7
This is like that :


/Users/rebouhaymen/Desktop/Aymen/IUT/Java/Tp1FormeJava/galaxy/Univers.java

what is the package declaration within Univers.java? That's say ? Univers.java have a package which is galaxy


Aymen Rebouh
Greenhorn

Joined: May 29, 2013
Posts: 7
Edit : This is resolved . I finally abandonned my build.xml and create a new :-)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem build.xml and Ant : Don't find the class
 
Similar Threads
jetty org.apache.axis2.AxisFault: The service cannot be found for the endpoint reference (EPR)
'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable
Ant: while compiling it doen not recognize junit related things and shows errors
Ant error: Make sure you have it in you classpath
JSP Compilation using ANT