Author | Message |
---|---|
hibbol
Posts: 20
|
Posted 17:00 Oct 21, 2010 |
I'm working on creating a new target on build.xml. When I run filetest ant, I have an error, which looks like this,
filetest:
It seems like it works fine with compile, but when I run the class file, it doesn't work. Please give me some clue to solve.
|
HuanXue
Posts: 34
|
Posted 17:02 Oct 21, 2010 |
Maybe you haven't modify build.xml, or doesn't create the property path correctly? |
hibbol
Posts: 20
|
Posted 17:26 Oct 21, 2010 |
I'm creating another target called "filetest" to run FileTest.java file on build.xml. |
cysun
Posts: 2935
|
Posted 19:11 Oct 21, 2010 |
If the error message says it cannot find the class, it means the class is not in classpath, and you need to add it to the classpath. |
hibbol
Posts: 20
|
Posted 22:26 Oct 21, 2010 |
Do I need to add also Jar files to make it work? I added the class path, but I got another error,
It doesn't find "import org.springframework.core.io.ClassPathResource;" I disabled that import on FileTest.java and it worked. Last edited by hibbol at
22:34 Oct 21, 2010.
|
cysun
Posts: 2935
|
Posted 08:09 Oct 22, 2010 |
There are actually two questions here: 1. Where is the jar file that contains the library? 2. How do I add jar files to the classpath of an Ant <java> task. The answer to 1 is WEB-INF/lib, and the answer to 2 is Ant documentation. |
hibbol
Posts: 20
|
Posted 13:49 Oct 22, 2010 |
I added jar files to the classpath of an Ant task. I got another errors and I fixed them. However, at the end, I got the same error again.
[jar] Building jar: C:\workspace\csns\build\classes\FileTest.jar
I still don't know why and what I missed. Last edited by hibbol at
13:50 Oct 22, 2010.
|
hibbol
Posts: 20
|
Posted 01:23 Oct 23, 2010 |
Here is errors I've got so far. Please look at it and tell me what is wrong. I wonder if it's postgresql driver connection problem or my code I implemented.
[java] Cannot load JDBC driver class 'org.postgresql.Driver' |