• Post Reply Bookmark Topic Watch Topic
  • New Topic

filter error  RSS feed

 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the line



I get this error :



Im using Java 7

Any idea?

Regards
 
Knute Snortum
Sheriff
Posts: 4287
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something's wrong with href. Where does this variable get set and how are you passing it in?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It says it cannot find class java.lang.CharSequence. This class has been in Java for a long time, since Java 1.4.

What version of Java are you using to run your program and on which operating system? Are you using a super old version (Sun Java 1.3 or older), or are you using some non-Oracle version of Java (maybe GCJ, GNU Classpath or something like that)?
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see you had the same or a similar problem a few months ago. What solved it last time?

http://www.coderanch.com/t/633451/java/java/find-class-file-java-lang

edit Net research suggests that this is a known Eclipse bug.
 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes it looks like it is href, String href = url.getURL().toLowerCase(); It looks like that is contains proper values

 
Knute Snortum
Sheriff
Posts: 4287
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Characters in a URL can confuse a regex. You will probably need to escape some of them. Take a look at URLEncoder and Decoder.
 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did this



same error

Any advice?
 
Knute Snortum
Sheriff
Posts: 4287
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Print href to a log or something so we can look at it.
 
Isaac Ferguson
Ranch Hand
Posts: 1063
3
Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This are the first block of results:



it has content with "%" I used encoded but it continues giving the error:



Any idea?
 
Campbell Ritchie
Marshal
Posts: 56584
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to a different forum as too difficult for “beginning”
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error has nothing to do with your code. Read Darryl's response above. Something is wrong with your Java setup, or maybe it's because of some bug in Eclipse as Darryl suggests.

The error message means that the class java.lang.CharSequence cannot be found. That is really strange, because that class is a normal, standard Java class that should be available, if you're using Java 1.4 or newer (and you are, because Java 1.4 is very long ago).

You can try changing your code, but that will not make that error go away. Find out if it's really a bug in Eclipse. If it is, see if you can update your Eclipse to a newer version.

Look at this, for example, and this. It might be that you have simply something wrong in your project configuration. For example, you've set it up so that Eclipse thinks you are using Java 7, while you are really using Java 8. If that's the case then you'll need to configure your project correctly in Eclipse.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!