File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Jikes in Ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Jikes in Ant" Watch "Jikes in Ant" New topic
Author

Jikes in Ant

Ajan Raj
Greenhorn

Joined: Jan 29, 2008
Posts: 10
Hi Friends,
I am newbie to jikes. Can anyone tell me that how to use jikes in Ant to compile my java Program. In the build.xml file instead of javac i had changed as jikes and run the build.xml, but i have got error message such as

"BUILD FAILED
D:\Ajan\Assignments\JikesAntTest\Jikes\bin\build.xml:31: Problem: failed to create task or type jikes
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.


Total time: 109 milliseconds"


And Here is the build.xml file


<?xml version="1.0" encoding="UTF-8"?>
<project name="UKLights" default="all" basedir=".">
<property name="src" value="src"/>
<property name="build" value="build"/>
<property name="lib" value="lib"/>
<target name="all" depends="UKLights"
description="Builds the whole project">
<echo>Doing all</echo>
</target>
<target name="UKLights"
description="Builds the main UKLights project">
<echo>Doing UKLights</echo>

</target>
<target name="check_eclipse">
<available property="in.eclipse" classname="org.eclipse.ant.core.EclipseJavac" />
</target>

<target name="set_eclipse" if="in.eclipse" depends="check_eclipse">
<property name="build.compiler" value="org.eclipse.pde.internal.core.JDTCompilerAdapter" />
<echo message="Internal Eclipse Compiler will be used" />
</target>

<target name="set_jikes" unless="in.eclipse" depends="check_eclipse">
<property name="build.compiler" value="jikes" />
<echo message="Jikes Compiler will be used" />
</target>



<jikes srcdir="${src}" destdir="${build}"/>
</project>


Can anyone help me out from this problem
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41865
    
  63
Hello "Ajan Expectations"-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. It must consist of a first name and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do using the "My Profile" link at the top of the page.

As to your questions, I haven't tried switching compilers using the "build.compiler" property, but if it takes a Java class name when using the Eclipse compiler, I think it's a safe bet that it would need a class name for using Jikes as well - which doesn't exist, since Jikes is written in C. Something like this works for me:


Ping & DNS - my free Android networking tools app
Ajan Raj
Greenhorn

Joined: Jan 29, 2008
Posts: 10
Ulf Dittmer wrote:Hello &quot;Ajan Expectations&quot;-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. It must consist of a first name and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do using the &quot;My Profile&quot; link at the top of the page.

As to your questions, I haven't tried switching compilers using the &quot;build.compiler&quot; property, but if it takes a Java class name when using the Eclipse compiler, I think it's a safe bet that it would need a class name for using Jikes as well - which doesn't exist, since Jikes is written in C. Something like this works for me:




Sorry i didn't get you. In the code which you have given, if we delete the two lines.
compiler=&quot;jikes&quot;
executable=&quot;/usr/bin/jikes.exe&quot;

then also it will work fine. Then what is the use of Jikes..
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41865
    
  63
Of course it works if you remove those lines - but then it uses the javac compiler. I thought you wanted to use jikes?
Ajan Raj
Greenhorn

Joined: Jan 29, 2008
Posts: 10
Ulf Dittmer wrote:Of course it works if you remove those lines - but then it uses the javac compiler. I thought you wanted to use jikes?


In the code which you have given. either javac will compile the java program or Jikes will compile the java program.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

"Ajan Expectations"

Please follow Ulf's post above on altering your screen name, it's a mandatory requirement for Javaranch, thanks!


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jikes in Ant