I' am using java jdk1.8.0_05. In the project i get an error as 'The type java.nio.CharBuffer cannot be resolved. It is indirectly referenced from required .class files' in the line:
new FileReader(filename).read(buffer);
How to solve this.
I' am using java jdk1.8.0_05. In the project i get an error as 'The type java.nio.CharBuffer cannot be resolved. It is indirectly referenced from required .class files' in the line:
new FileReader(filename).read(buffer);
How to solve this.
Eclipse is out of date. The old version that produce the errors is eclipse "Helios". I tried the most recent version Eclipse "Mars" and the build passed.
I was experiencing the same issue with a recently ported project. My situation was that I installed the newest version of Java on startup and attached it to my previous projects. There was some other minor issues that I fixed but this was not one of them. I found that according to the website, all of the documentation was available, the class was part of my install, however was not found.
I eventually fixed this by just reverting back to JDK1.7. Fixed my problem instantly, but I would love a little more attention and a better answer then changing back versions.
I was also experiencing this with the Hive Web Interface with the war file hive-hwi-0.12.0.war.
General solution: Locate the new FileReader(filename).read(buffer) statement in the java/jsp code. The method read() with 1 parameter (in this case buffer) is somehow not supported in the "lower" java 1.8 versions. Instead of passing 1 parameter, 3 parameters should be passed: buffer, offset and bufferlength. Change the statement in "new FileReader(filename).read(buffer,0,buffer.length);"
For Hive Web Interface in file view_file.jsp change statement "cread=br.read(c)" into "cread=br.read(c,0,c.length)".
I realize this comes a bit late, but it's not marked as solved, so I'll share.
I had this experience with java.nio.FloatBuffer
in a clean install of Ubuntu 15.04, using OpenJDK 8. You didn't specify which OS you're using, so here's what fixed it for me:
Install the openjdk-7-jre-lib
package; e.g. sudo apt-get install openjdk-7-jre-lib
Note that there's no openjdk-8-jre-lib
package in the default list of repositories.
This assumes you have your build path properly configured. See this SO post for more info on that.
I am using eclipse mars first we need to check the Jre installed libraries and build them,after that clean u r project now the problem is resolved.