Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am having a problem compiling a j

Status
Not open for further replies.

wahoo31

Programmer
Jun 13, 2002
3
US
I am having a problem compiling a java file in UNIX. I continue to try to compile a .java file that uses regex expressions and includes the line

import java.util.regex.*;

However, each time i compile
the file it gives me this error:

Parser.java:2: Package java.util.regex not found in import.
import java.util.regex.*;
^
1 error

i was wondering if there is anything else i needed to do to make it
find the regex expressions. any suggestions would be greatly
appreciated....Thanks
 
Have you tried "import java.util.regex;"?

The ".*" is used for an entire library. I don't have a jdk here at my desk, but I'm assuming that regex is one member of the util library, therefore appending ".*" to the end of it is invalid.

But like I said, I can't test this myself at the moment so I may be entirely wrong, but much of the time, this is the cause of compile errors such as yours.
 
I just tried leaving off the ".*" and i got the same error....The same program runs on my windows machine and compilies fine with java version 3.0...but for some reason it wont compile on my UNIX box...i am out of things to try so keep coming with the suggestions...thanks!
 
I think you have a .jar file in the windows system that is missing on the Unix machine; perhaps you can find it, transfer it and put it in the class path. I think you are right with 'import java.util.regex.*;'

An other possibility: do you have the same version of JDK on both machines? I think java.util.regexp was new in 1.3.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top