Java compilation error


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 09-27-2018
Java compilation error

i am on red hat Linux .


Code:
package hiveudf;
import org.apache.hadoop.hive.ql.exec.UDF;
import org.apache.hadoop.io.Text;
public class lowercaseudf extends UDF {
    public Text evaluate(final Text s) {
        if (s == null) { return null;}
        return new Text(s.toString().lowerCase());
        }
        }
}


Code:
# javac -classpath /usr/hdp/2.6.5.0-292/hive2/lib/*:/usr/hdp/2.6.5.0-292/hadoop/*:/usr/hdp/2.6.5.0-292/hadoop-mapreduce/* lowercaseudf.java
lowercaseudf.java:7: error: cannot find symbol
        return new Text(s.toString().lowerCase());
                                    ^
  symbol:   method lowerCase()
  location: class String
1 error

# 2  
Old 09-30-2018
I think the correct Java method for lowerCase() is:

Code:
toLowerCase()

Maybe you can try:

Code:
 return new Text(s.toString().toLowerCase());

# 3  
Old 11-27-2018
I think the main problem is obtain in this code where this code have put.
Code:
 if (s == null) { return null;}
        return new Text(s.toString().lowerCase());

Moderator's Comments:
Mod Comment Please do not put advertisements and links in your post. If you keep posting "me too" replies with links you will be banned, sorry. I have given you a 10 point infraction for 6 months for continually posting links.
# 4  
Old 3 Weeks Ago
Quote:
Originally Posted by Neo
I think the correct Java method for lowerCase() is:

Code:
toLowerCase()

Maybe you can try:

Code:
 return new Text(s.toString().toLowerCase());

i agree,
toLowerCase() and not lowerCase().

Can't find symbol and in this case it's pointing to the method name lowerCase() means that this method does not existe.
# 5  
Old 1 Week Ago
Quote:
Originally Posted by gulatisneha56
Excellent answer by Neo. I agree with you. Thank you.
gulatisneha56, you need to add more value than that to be a valued member here at unix.com. Most posts like yours are interpreted by members here as a precursor to spamming the site.

Caution is advised Smilie
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Java compilation problem - path not set Nancy Wilson Programming 4 10-20-2018 05:33 AM
Unable to correct NMONVisualizer java error. Can someone help to decode this java error? okonita AIX 1 04-07-2015 05:31 AM
Compilation Error yschd Programming 2 06-01-2009 10:19 AM
Pro*c compilation error satvd Shell Programming and Scripting 1 05-21-2008 07:47 AM
pro*c compilation error satvd Programming 0 05-21-2008 06:04 AM
Compilation error : Please help jagan_kalluri Programming 1 05-20-2008 05:48 PM
Need help in resolving Compilation error jagan_kalluri UNIX for Dummies Questions & Answers 1 05-20-2008 03:45 PM
C Question compilation error jaganreddy Programming 1 05-12-2008 11:05 AM
compilation error mannam srinivas HP-UX 2 04-18-2008 02:52 PM
c++ compilation error mannam srinivas Linux 12 04-17-2008 04:03 AM
Compilation error mansoorulhaq Programming 3 10-23-2007 09:01 AM
compilation error smanu Programming 2 12-29-2006 10:11 AM
Regarding compilation error. sweta Programming 1 12-10-2006 11:30 AM
compilation error in gcc ls1429 Programming 9 06-21-2006 12:02 PM
Pthread compilation error basavaraj_m UNIX for Dummies Questions & Answers 1 10-13-2000 02:22 AM