2

I have completed an assignment. However, I am unfamiliar with javac compiler error messages, and can not find an explanation for the following error message.

> ----------Compilation output--------------------------------------------
> javac Main.java
> classes in application are
> Main.java:class Main
> Main.java:class Envelope
> Letter.java:class Envelope{
> Letter.java:public class Letter {
> ./Letter.java:12: duplicate class: Envelope
> class Student{
> ^
> 1 error

I have no idea what to make of it and would appreciate any explanation of what I am doing wrong.

1
  • 1
    Could you show the source code? Commented Feb 11, 2012 at 20:03

1 Answer 1

4

The problem is that you have two classes called Envelope.

Main.java:class Envelope
Letter.java:class Envelope

If they are supposed to be different classes then rename one of them.

If they are supposed to be the same class then put it in is own file, rather than copy + pasting the code every time you need it.

Sign up to request clarification or add additional context in comments.

2 Comments

Mark, talk about fast! Thanks for the swift response. Your assistance is much appreciated.
Mark this as the answer by pressing the tick on the left. This will help others to identify that this question has been solved. @juan

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.