This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes Build Failed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Build Failed" Watch "Build Failed" New topic

Build Failed

Ambika Kumar

Joined: Jan 27, 2006
Posts: 13

After running this ANT (for RMI), I came across an Error "Build Failed : Java Returned 1"

I can't understand it. Please can anyone help me.

Sourse code:


<target name="compile">
<javac srcdir="D:\Practise\RMI">
<include name=""/>
<include name=""/>

<target name="stub" depends="compile">
<rmic classname="myRMIImpl" base="D:\Practise\RMI"/>

<target name="background" depends="stub">
<exec executable="cmd" spawn="true">
<arg line="/c start rmiregistry" />

<target name="RunServer" depends="background">
<jar destfile="D:\Practise\RMI\myRMIServer.jar"
<attribute name="Main-Class" value="myRMIServer"/>

<java jar="D:\Practise\RMI\myRMIServer.jar" fork="true" failonerror="true" >
<pathelement location="D:\Practise\RMI\" />
<pathelement path="myRMIImpl_Skel.class, myRMIImpl_Stub.class," />
<echo message = "Server Running --- Waiting for Client Request " />

Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

Was it the java element in the RunServer target that threw the exception? The contents of the classpath element looks wrong in there - it should point at directories or JAR files, not at specific classes... besides - it looks like you are running from "myRMIServer.jar" directly - if you aren't using any classes outside of this JAR or the default Java classes that come with the JDK - you shouldn't need to set the classpath anyway.

Also, usually there is more information about why the build failed... that would help, too, if this doesn't fix your problem...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
It is sorta covered in the JavaRanch Style Guide.
subject: Build Failed
It's not a secret anymore!