File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Two classes output on compile ?

 
Jerome Donaldson
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Ive compiled q java program and it created two classes.

I have a java program that Ive compiled using 1.7(or something like that)

Source - RPGMail.java

RPGMail$1.class
RPGMail.class

The program was working correctly before I compiled it, I compiled it. Now it Im getting a class not found.

Ive never seen this before.
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your result suggests that RPGMail contains an anonymous inner class. That's nothing to worry about. If it's a short class, you could post the code and we could point out where that second class is coming from.

You'll have to be clearer on your claim that your program worked before you compiled it. There is no program before compiling, and I'm having trouble sussing out what you actually meant to say.
 
Jerome Donaldson
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im not sure what you mean about program didnt exist. I kinda new at this.
I added some code to allow authentication for smtp emailing. It's been bolded I think.



 
Ranji Sura
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you don't mind , I would like to ask you, How did you try to run the program... I mean using the command line or any other IDE like netbeans ... ?
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whoa! That's more code than I was expecting, but your anonymous inner class is on lines 172 - 175. The compiled version of those lines is what's contained in RPGMail$1.class.

OK, so you start with source code, you compile it into class files, and you execute it as a program. Before you compile, you don't even have a program to execute, so saying that it was working fine before compilation doesn't make sense. It's like saying your car works great until you turn it on, or you were bowling a perfect game until the first frame. Maybe you mean you recompiled this code and the overall program stopped working. Or maybe you added some functionality to your program, implemented to some extent by this code, and now the program doesn't work.You've got to be more specific on what's going wrong, and maybe include the error message you're getting.
 
Ty Davis
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im sorry I forgot to thank you for your post. It helped me resolve my problem.

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic