Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
    Bookmark Topic Watch Topic
  • New Topic

Compiling In console

 
amarshi mohanty
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,
below are the files I do have:
1.D:\Console\FileDownlaod.java
2.D:\Console\XmlGenerator.java
3.D:\Console\servlet-api.jar
4.D:\Console\log4j-1.2.8.jar

Now i am using :javac -classpath D:\Console\servlet-api.jar;D:\Console\log4j-1.2.8.jar D:\Console\FileDownlaod.java
So i have
5.D:\Console\FileDownlaod.class

XmlGenerator.java calles for the FileUpload class for a cetain functionality,so iah to compile FileUpload.ajava first.
Now how to compile the XmlGenerator.java:
I used:
1. javac -classpath D:\Console\servlet-api.jar;D:\Console\log4j-1.2.8.jar;D:\Console\FileDownlaod.class D:\Console\XmlGenerator.java
Errors I am getting:
1.error: error reading D:\Console\FileDownlaod.class; error in opening zip file
2.D:\Console\XmlGenerator.java:10:
cannot symbol : class FileDownlaod
location: package com.photo.servlet
import com.photo.servlet.FileDownlaod;

3. D:\Console\XmlGenerator.java:53: cannot find symbol
symbol : variable FileDownlaod
location: class com.photo.servlet.XmlGenerator
filelist = new File(FileDownlaod.ServerPath);

I even tried to convert the FileUpliad.class to .jar file and use it like servlet-api and log4j.jars , but it shows the below error
javac -classpath D:\Console\servlet-api.jar;D:\Console\log4j-1.2.8.jar;D:\Console\D:\Console\FileDownlaod.jar D:\Console\XmlGenerator.java.


Please tell me the valid syntax.


 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Report post to moderator
Don't specify class files explicitly; specify the class directory only. Continue specifying jar files as you are now.
 
Ankit Garg
Sheriff
Posts: 9580
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
If you want to include all the jars in a folder in the classpath, then include <directory path>\* in the classpath.

Also this question seems quite similar to your other topic to me...
 
    Bookmark Topic Watch Topic
  • New Topic