• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Javac error

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi...using java file im doing compile...javac

i incllude all java file & .classpath & jar files...my issue is my build is got success message but class file not creating in that distfolder...please tell me clear details for javac...i check google also..using that information i updated...but not class file generating for my scripts...

<javac srcdir="${src}" destdir="C:\ant\Output" classpath="${src}/commonj-sdo-2.1.0.jar">
<include name="**/*.*"/>

please any one help for this...

 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let us see the script output.
 
kumar hai
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
means....i am not understand....help clear with this..
 
Ranch Hand
Posts: 470
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kumar,

1) Check http://faq.javaranch.com/java/UseCodeTags

2) The code you have posted doesn't have enough information to answer your question. You have to post entire build.xml file, also check http://faq.javaranch.com/java/PostRealCode

3) Most likely in your build.xml, you just do no call the target which contain the code you have posted. In this case you would get "BUILD SUCCESSFUL" message from ANT, but because your code is kind of commented out - no class file will be created.
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let us see the script you are using and also the output you are getting when you execute the script
 
kumar hai
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<copy flatten="true" todir="${jar.file}">
<fileset dir="${src}" includes="**/.classpath,**/gen/**,**/*.MF,**/*.jar"/>
</copy>

<copy flatten="true" todir="${java.file}">
<fileset dir="${src}" includes="**/*.java"/>
</copy>
</target>

<target name="compile">
<javac srcdir="${java.file}" destdir="${class}" classpath="${jar.file}/log4j-1.2.15.jar"/>
</target>


Hi,
please check above copy tasks...i am copy .classpath file,.jar fil & other files to on location,,,& also i am copy java file to one location...

in javac task i am compiling all java file & include jar file(this is classpath file)..& also below i mention .classpath file details..please tell me if i need to include any more file for compiling...


------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="lib" path="log4j-1.2.15.jar"/>
<classpathentry excluding="gen/|gen/src/" kind="src" path=""/>
<classpathentry kind="src" path="gen/src">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/WebSphere Process Server v6.2 JRE"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/com.ibm.ws.ast.st.runtime.runtimeTarget.v61.bi/wps.v62"/>
<classpathentry kind="output" path=""/>
</classpath>

---------------------------------------
 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the output you are getting when you execute the script???

I am not sure about eclipse classpath file.

But i believe your script is not finding the source file properly...

So let me see the output when you run the script

Also why do you use flattern???i think it will erase out the directory structure of your source file.
 
kumar hai
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
im not include that .classpath file...only jar file i inlucde

<target name="compile">
<javac srcdir="${java.file}" destdir="${class}" classpath="${jar.file}/log4j-1.2.15.jar" fork="yes">
</javac>

below the output:

please help ....



Buildfile: javac.xml

copy:
[delete] Deleting directory c:\ant\java.class
[delete] Deleting directory c:\ant\jars
[mkdir] Created dir: c:\ant\jars
[mkdir] Created dir: c:\ant\java.class
[delete] Deleting directory c:\ant\class
[mkdir] Created dir: c:\ant\class
[copy] Copying 4 files to c:\ant\jars
[copy] Copied 2 empty directories to 2 empty directories under c:\ant\jars
[copy] Copying 4 files to c:\ant\java.class

compile:
[javac] Compiling 4 source files to c:\ant\class

BUILD FAILED
C:\ant\javac.xml:32: Error running javac.exe compiler

 
Siva Masilamani
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe your javac is not in the path

Type javac in your command prompt and if you are getting command not found.

Then set the PATH for the javac.


Your path should contain something like this.

PATH=c:/java/jdk1.5/bin

Do not delete the existing path.Just add the above path to it.

then type javac -version.

Then try running your script
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags when posting code or configuration. Unformatted code and configuration is very difficult to read. You can edit your post to include them by using the button.
reply
    Bookmark Topic Watch Topic
  • New Topic