Re: classfile has wrong name WRT package?



Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>cd java

C:\java>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java

06/25/2006 06:20p <DIR> .
06/25/2006 06:20p <DIR> ..
06/25/2006 06:19p <DIR> build
06/19/2006 03:25p 677 build.groovy
06/25/2006 06:19p 1,291 build.xml
06/25/2006 05:51p 1,310 build.xml.HelloWorldApp
06/25/2006 05:41p <DIR> src
06/24/2006 10:05p <DIR> vendor
3 File(s) 3,278 bytes
5 Dir(s) 815,157,248 bytes free

C:\java>ant
Buildfile: build.xml

clean:
[delete] Deleting directory C:\java\build

prepare:
[mkdir] Created dir: C:\java\build\prod

compile:
[javac] Compiling 1 source file to C:\java\build\prod

package:
[jar] Building jar: C:\java\HelloWorldApp.jar

BUILD SUCCESSFUL
Total time: 31 seconds
C:\java>
C:\java>dir
Volume in drive C has no label.
Volume Serial Number is FCD2-42DE

Directory of C:\java

06/25/2006 06:21p <DIR> .
06/25/2006 06:21p <DIR> ..
06/25/2006 06:20p <DIR> build
06/19/2006 03:25p 677 build.groovy
06/25/2006 06:19p 1,291 build.xml
06/25/2006 05:51p 1,310 build.xml.HelloWorldApp
06/25/2006 06:21p 967 HelloWorldApp.jar
06/25/2006 05:41p <DIR> src
06/24/2006 10:05p <DIR> vendor
4 File(s) 4,245 bytes
5 Dir(s) 815,153,152 bytes free

C:\java>java -jar HelloWorldApp.jar
Hello World!

C:\java>type build.xml
<?xml version="1.0"?>
<!--

Just a simple HelloWorld app

-->

<project name="Hello" default="package" basedir=".">

<property name="build.dir" location="build"/>
<property name="build.prod.dir" location="${build.dir}/prod"/>
<property name="doc.dir" location="doc"/>
<property name="index.dir" location="index"/>
<property name="src.dir" location="src"/>
<property name="test.dir" location="test"/>
<property name="vendor.lib.dir" location="vendor/lib"/>

<property name="pkg" value="thufir.bonjour"/>
<property name="mainClass" value="HelloWorldApp"/>

<path id="project.classpath">
<pathelement location="${build.prod.dir}" />
</path>

<target name="clean">
<delete dir="${build.dir}" />
</target>

<target name="prepare" depends="clean">
<mkdir dir="${build.prod.dir}"/>
</target>


<target name="compile" depends="prepare">
<javac srcdir="${src.dir}" destdir="${build.prod.dir}">
<classpath refid="project.classpath" />
</javac>
</target>


<target name="package" depends ="compile">
<jar jarfile="${mainClass}.jar"
basedir="${build.prod.dir}" >
<manifest>
<attribute name="Main-Class"
value="${pkg}.${mainClass}" />
</manifest>
</jar>
</target>
</project>

C:\java>
C:\java>


all that's left is to sign the jar, and automagically execute the jar
from ant!



-Thufir

.



Relevant Pages

  • destdir for jar in build.xml
    ... How can I get specify where a jar gets created, ... Microsoft Windows 2000 ... Deleting directory C:\newJava ...
    (comp.lang.java.help)
  • package jarfile from ant
    ... Microsoft Windows 2000 ... Volume in drive C has no label. ...
    (comp.lang.java.help)
  • Re: inline manifest.mf for foo.jar from build.xml using ant
    ... It seems that ant's now creating the jar, but there's something wrong, ... Volume in drive C has no label. ... Exception in thread "main" java.lang.NoClassDefFoundError: ...
    (comp.lang.java.help)
  • Re: Using a Combo Box to Find Records
    ... NameOfCombo, and the instruction "Replace NameOfCombo of your combo". ... This underlines the font in ExitLabel, which is presumably a label, probably ... A compile error contains some sort of description. ... Dim intOption As Integer ...
    (microsoft.public.access.forms)
  • Re: Pee Wees documents available
    ... Not withstanding the obvious handling/chain of custody errors, ... If a man cannot look at the label on a jar and write the number typed thereon ... The container of piss that was ...
    (rec.bicycles.racing)