• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Jikes in Ant

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:
 
Ajan Raj
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Ajan Expectations"

Please follow Ulf's post above on altering your screen name, it's a mandatory requirement for Javaranch, thanks!
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic