aspose file tools*
The moose likes Beginning Java and the fly likes Two classes output on compile ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Two classes output on compile ?" Watch "Two classes output on compile ?" New topic
Author

Two classes output on compile ?

Jerome Donaldson
Greenhorn

Joined: May 11, 2005
Posts: 13
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

Joined: Oct 01, 2001
Posts: 2861
    
  11

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

Joined: May 11, 2005
Posts: 13
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

Joined: Oct 28, 2012
Posts: 84
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

Joined: Oct 01, 2001
Posts: 2861
    
  11

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

Joined: Mar 01, 2013
Posts: 6
Im sorry I forgot to thank you for your post. It helped me resolve my problem.

 
Consider Paul's rocket mass heater.
 
subject: Two classes output on compile ?