473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

pathelement with javac

I think the compile target is causing the errors...?

from the terminal:

[thufir@localhost java]$ cat build.xml
<project name="tidy" default="package">

<import file="tidyBuild/properties.xml" />

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

<target name="prepare" depends="clean">
<mkdir dir="${outputDir}" />
</target>

<echo message="classpath=${cp}" />

<target name="compile" depends="prepare">
<javac
srcdir ="${sourceDir}"
destdir ="${outputDir}">
<classpath>
<pathelement location="${tidy.path}" />
</classpath>
</javac>
</target>

<target name="package" depends="compile">
<jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}"

<manifest>
<attribute name="Main-Class"
value="${pkgPath}${mainClass}"/>
</manifest>
</jar>
</target>

</project>
[thufir@localhost java]$ cat tidyBuild/properties.xml
<project name="properties" basedir=".">
<property name="outputDir" value="bin/" />
<property name="sourceDir" value="src/atreides/tidyXhtml/" />
<property name="mainClass" value="Test16" />
<property name="pkgPath" value="atreides.tidyXhtml." />
<property name="user.name" value="thufir" />
<property name="cp" refid="tidy.path" />

<path id="tidy.path">
<pathelement location="lib/Tidy.jar" />
</path>
</project>
[thufir@localhost java]$ cat src/atreides/tidyXhtml/Test16.java
package atreides.tidyXhtml;

import java.io.IOException;
import java.net.URL;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.io.FileWriter;
import org.w3c.tidy.Tidy;
public class Test16 implements Runnable {

private String url;
private String outFileName;
private String errOutFileName;
private boolean xmlOut;

public Test16(String url, String outFileName,String
errOutFileName, boolean
xmlOut){
this.url = url;
this.outFileName = outFileName;
this.errOutFileName = errOutFileName;
this.xmlOut = xmlOut;
}//Test16

public void run() {
URL u;
BufferedInputStream in;
FileOutputStream out;
Tidy tidy = new Tidy();

tidy.setXmlOut(xmlOut);
try {
tidy.setErrout(new PrintWriter(new
FileWriter(errOutFileName), true));
u = new URL(url);
in = new BufferedInputStream(u.openStream());
out = new FileOutputStream(outFileName);
tidy.parse(in, out);
}//try
catch ( IOException e ) {
System.out.println( this.toString() + e.toString() );
}//catch
}//run

public static void main( String[] args ) {
Test16 t1 = new Test16(args[0], args[1], args[2], true);
Test16 t2 = new Test16(args[3], args[4], args[5], false);
Thread th1 = new Thread(t1);
Thread th2 = new Thread(t2);

th1.start();
th2.start();
}//main
}//Test16
[thufir@localhost java]$
[thufir@localhost java]$ ant
Buildfile: build.xml
Overriding previous definition of reference to tidy.path
[echo] classpath=/home/thufir/java/lib/Tidy.jar

clean:
[delete] Deleting directory /home/thufir/java/bin

prepare:
[mkdir] Created dir: /home/thufir/java/bin

compile:
[javac] Compiling 1 source file to /home/thufir/java/bin
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:9:
package
org.w3c.tidy does not exist
[javac] import org.w3c.tidy.Tidy;
[javac] ^
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:30:
cannot find
symbol
[javac] symbol : class Tidy
[javac] location: class atreides.tidyXhtml.Test16
[javac] Tidy tidy = new Tidy();
[javac] ^
[javac] /home/thufir/java/src/atreides/tidyXhtml/Test16.java:30:
cannot find
symbol
[javac] symbol : class Tidy
[javac] location: class atreides.tidyXhtml.Test16
[javac] Tidy tidy = new Tidy();
[javac] ^
[javac] 3 errors

BUILD FAILED
/home/thufir/java/build.xml:18: Compile failed; see the compiler error
output for
details.

Total time: 5 seconds
[thufir@localhost java]$

thanks,

Thufir

Jul 20 '05 #1
5 1808
this seems to fix the problem. here's the new build.xml:

<project name="tidy" default="package">

<import file="tidyBuild/properties.xml" />

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

<target name="prepare" depends="clean">
<mkdir dir="${outputDir}" />
</target>

<echo message="classpath=${cp}" />

<target name="compile" depends="prepare">
<javac
srcdir ="${sourceDir}"
destdir ="${outputDir}">
<classpath>
<path refid="tidy.path" />
</classpath>
</javac>
</target>

<target name="package" depends="compile">
<jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}" >
<manifest>
<attribute name="Main-Class"
value="${pkgPath}${mainClass}"/>
</manifest>
</jar>
</target>

</project>
is ant offtopic here, or something?
-Thufir

Jul 20 '05 #2
Hello !
It llok like a java class to make a XML files, using read write append
?

Do i mistake?

Can java class be used in client side ?
To automatize data input and file writing ?
I can't invest on a server and its softs.

I have a structured work to save on local drive, linear files like TXT
are of no use.
Actually all the work is or in my mind or on thousands of papers with
cross references.
It is no dictionary like, linear job to do.

Dynamic files can help, because while already structured the info put
on the files can be used to build a more structured file or more
structured files.

It become complex, to explain, it is only a work of linguistic, and it
can be done by a computer.

Any info back, welcome.

Regards.
HALLES.

Jul 20 '05 #3
HALLES wrote:
Hello !
It llok like a java class to make a XML files, using read write append
?

Do i mistake?
I don't believe so :)
Can java class be used in client side ?
sure, send this class a URL and it will tidy-ize it. that is, take old
fashioned html and convert it to XHTML. my pet project is to work on
some html files which exist on my hard drive, along the lines of your
plans.
To automatize data input and file writing ?
I can't invest on a server and its softs.

I have a structured work to save on local drive, linear files like TXT
are of no use.
Actually all the work is or in my mind or on thousands of papers with
cross references.
It is no dictionary like, linear job to do.

Dynamic files can help, because while already structured the info put
on the files can be used to build a more structured file or more
structured files.

It become complex, to explain, it is only a work of linguistic, and it
can be done by a computer.

Any info back, welcome.

Regards.
HALLES.

check out the tidy and jtidy projects on <http://www.sourceforge.net/>.
-Thufir

Jul 20 '05 #4
Hello.

You speak of URL, i can't see how to declare an drive as an URL.

I have stopped programing 10 years ago, i used TP 7, nice but 16 bit
limited.

I will try jtidy.

Regards.

HALLES ;o)

Jul 20 '05 #5
HALLES wrote:
Hello.

You speak of URL, i can't see how to declare an drive as an URL.
pardon, it doesn't have to be a URL. when you unzip the files from
sourceforge there will be a file names Tidy.jar, this is what you're
after. when you feed a html file through Tidy.jar it will convert it
to xhtml, like magic. the java code I have, Test16, that happens to
take a url as input, however, Tidy.jar will take any html file as input
as far as I know. To my knowledge it should be trivial to feed it a
file, foo.html, versus a URL.
I have stopped programing 10 years ago, i used TP 7, nice but 16 bit
limited.
java is object oriented, just as a heads up.
I will try jtidy.

Regards.

HALLES ;o)


I've sent you an e-mail, since this is getting off topic for xml.

-Thufir

Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Interzoner | last post by:
I am new at Java.. I installed j2sdk-1.4.2-nb-3.5-bin-windows on a Windows 2000 machine I can't find a "Javac"file......
2
by: zku | last post by:
how to create java bytecode without using javac?
2
by: Samuel Jackson | last post by:
Hi, I'm wanting to figure out what version bytecode is generated with Jikes. I'm developing in an environment where it's mandated we run on Java 1.3. I'd like to run Jikes as my compiler (for...
0
by: asaguden | last post by:
Hello, My problem is making 'javac -target 1.2 -bootclasspath /jre1.2/lib/rt.jar' work under jdk 1.4.2 on solaris with applets. Explanation: We have a web application jsp/servlets with applets....
1
by: GG | last post by:
Hi all, This is not necessarily an Ant question, nor a standard sun Javac. I am using both, and all suggestions are welcome. I would like to build as many classes as possible from a given...
2
by: Fred | last post by:
I have just upgraded from Tomcat 5.0 to 5.0.27 and when I try to veiw the website I am getting an error message root cause of "Unable to find a javac compiler;com.sun.tools.javac.Main is not on the...
3
by: Ed Severn | last post by:
I'm sorry of this question has been posed and answered many times before. But I have avoided using the "package" statement because of this. Most of my classes have no "package" statement, and...
0
by: mamoon | last post by:
hi all, background information: 1. OS- RedHat Enterprise Linux4 2. JDK installed- java-1.4.2-gcj hi, i am a newbie trying to compile my java programs. i checked whether any JDK is installed on...
9
dmjpro
by: dmjpro | last post by:
Hi .... I am trying to compile my generated Java code. Then I am getting an error .... "javac": CreateProcess error=2. The command is ... javac -d...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.