• Post Reply Bookmark Topic Watch Topic
  • New Topic

Urgent! error in compiling package java files on nt using  RSS feed

 
meimei li
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, dear all,
I got a compilation error on NT whose solution eluded me. Your help is highly appreciated.
On NT platform, I have a "Java" directory that contains subdirectory "com/mmm/mdap/adminServlets". In this subdir, there are a java file called "AdminRequestHandler.java" which is packaged into "com/mmm/mdap/adminServlets". I compiled it successfully on sun, but ran into following error on NT:
Compiling com/mmm/mdap/adminServlets/AdminRequestHandler...
com/mmm/mdap/adminServlets/AdminRequestHandler.java:14: Public class com.mmm.mdap.adminServlets.AdminRequestHandler must be defined in a file called "AdminR
equestHandler.java".
public class AdminRequestHandler implements ServletWorker.

Here is the beginning part of file "AdminRequestHandler.java":
package com.mmm.mdap.adminServlets;
import java.net.Socket;
import java.awt.Dialog;
import java.io.*;
import java.util.*;
import java.util.Properties;
import javax.servlet.http.*;

public class AdminRequestHandler implements ServletWorker
{
...
}
I started compilation in "Java" directory and classpath includes ".".
I don't understand why compiler requested the file to be called "AdminRequestHandler.java". And how to solve this error?
Thanks again.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check the spelling again looking for capitalization errors.
By the way, were you aware the folks at JavaRanch get shot for using the "U" word .
 
meimei li
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know "urgent" is not for use in the forum. The previous message is my first post after I joined the club.
I checked spelling and it seems that "AdminRequestHandler.java" is in right case.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by meimei li:
I don't know "urgent" is not for use in the forum. The previous message is my first post after I joined the club.

That's all right. Just send a "virtual beer" to Paul Wheaton and all will be forgiven .
As to the other, hmmmm are there any other classes in the same file with this? Like a second public class maybe?
Could there be some invisible characters on the line in the file that declares the class. Try deleting that line and retyping it exactly like the file name.
 
Murali Nanchala
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you move the files over from the Solaris box to the NT box? If you used FTP, then try that again, but this time, make sure you set the file type to ascii before you move the files.
Try compiling after the fresh move. If you still have a problem, then yell "Houston! we have a problem!" loudly - J/K
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!