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

Compiling In console

 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.


 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Don't specify class files explicitly; specify the class directory only. Continue specifying jar files as you are now.
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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