Re: How to compile a java program w/ another java programs which are w/o a main method



cjeffwang@xxxxxxxxx wrote:
I have been reviewing my "Java Tutorial" lately.  For the
CounterDemo.java in IO\example-1dot1, javac CounterDemo.java showed an
error message that can not find the CountWriter/CountReader classes. I
have compiled these two java files at the same driectory.

That sounds odd. Are you saying that CountWriter.class and CountReader.class are both in the same directory as CounterDemo.java?

How do I compile counterDemo.java?

It should compile OK if the class files for CountWriter/Reader are present, as I was asking above, but your compilation errors below (now snipped) are suggesting they are *not* found.

Did you put any package statements in the other classes?
(Did you change them at all?)

Try this.

G:\J...\example-1dot1>javac -classpath . CounterDemo.java
.



Relevant Pages

  • Re: intel compiler problem
    ... The error message seems ... Declarations are absolutely critical to diagnosing compilation ... Just seeing the isolated code line doesn't help ...
    (comp.lang.fortran)
  • Bug Report: Unclear Error Message
    ... When you by mistake have two properties with same id in dual interface in ... idl file the compilation fails and the error message does not point to the ...
    (microsoft.public.vstudio.general)
  • Re: No syntax control during webservice validation in Visual Studio 8
    ... An error occurred during the compilation of a resource ... Compiler Error Message: CS1002:; expected ... I created another web service solution and everything works fine there ... Validating Web Site ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Error Occured during compilation
    ... > I get two different errors when i compile it with 'gcc' as well as ... > gcc compilation ... If you don't show us the actual error message, ... I compiled your code under Cygwin, ...
    (comp.lang.c)
  • Re: Backup Error
    ... denied" error message when you log on to Windows SharePoint Services ... An error occurred during the compilation of a resource ... Compiler Error Message: CS0016: Could not write to output file ...
    (microsoft.public.windows.server.sbs)