org.apache.commons.codec Cannot be resolved - eclipse

I'm trying to import org.apache.commons.codec.binary.Base64.encodeBase64, but Eclipse keeps telling me this import cannot be resolved, even though I've added the apache commons codec jar file to both the lib file of my project and also as an Eclipse plugin. What could be causing this issue?

org.apache.commons.codec.binary.Base64.encodeBase64 is a method. You import Types, like org.apache.commons.codec.binary.Base64.

Related

openfire build install4j jar file

I am trying to build openfire from the source code. getting compile time error. below classes not found.
import com.install4j.api.Context;
import com.install4j.api.ProgressInterface;
import com.install4j.api.UninstallAction;
from where we can download these jar files. tried
https://mvnrepository.com/artifact/com.install4j?sort=newest
all the jar file still does not work. Any idea.
Thanks
Mohsin
The install4j artifacts are available from the repository
https://maven.ej-technologies.com/repository
See https://www.ej-technologies.com/resources/install4j/help/api for more information.

import scala.io.StdIn

I'm using Eclipse ScalaIDE and for some reason I'm not able to
import scala.io.StdIn
I'm getting a red squiggly that tells me:
object StdIn is not a member of package io
And I'm seeing that it's not in that scala.io jar file. The ScalaDoc, however says it should be there. I've tried both scala 2.10.4 and 2.11.5. I've used the Eclipse ScalaIDE to create the scala project and I've also created an sbt eclipse project directly using the scalasbt.plugin which I use all the time to manage ScalaIDE dependencies.
sbt "eclipse with-source=true"
Neither way is getting it.
I'm currently taking the Coursera Reactive Programming course and an assignment file has this import. I'm able do compile the project with sbt directly, but Eclipse ScalaIDE is not doing the job. Any clues? There may be good reason why not to use scala.io.StdIn, but my question is why can I not get it to import in the ScalaIDE?
thank you
scala.io.StdIn is new in scala 2.11.x and does not exist in previous versions.
The problem you are likely encountering is that ScalaIDE is not picking up the scala version you are specifying. Since you say that you tried it with 2.10.4, it probably still has that cached or set somewhere and it's failing because it cannot find the specified class.

The import org.apache.camel cannot be resolved

Yesterday I was working in my project. Today when I opened eclipse there is an error:
The import org.apache.camel cannot be resolved in .java file.
I tried to add .jar file then I got another error:
The import org.springframework cannot be resolved.
Then I tried to add this .jar and I got another error. What happened overnight?
Note: There is maven integration with my eclipse.
you need to specify versions for each library defined in pom.xml file.

Scala eclipse plugin java.lang.ClassNotFoundException

I am using eclipse Version: 3.7.2 with the Scala IDE for Eclipse 2.1.0.nightly-2_09-201203121521-6e8582e. The java version is 1.6.0_31. The OS is Ubuntu 11.10.
I have looked for solutions to this problem, but I have not found one yet. I hope there is not an obvious answer that I have missed.
I have this class (note the package):
package model.x.y
import org.scalatest.FunSuite
import org.junit.runner.RunWith
import org.scalatest.junit.JUnitRunner
#RunWith(classOf[JUnitRunner])
class GibberishTestSuite extends FunSuite {
test("Check Gibberish") {
assert("blah" === "blah")
}
}
I am also using gradle and the source path looks like this (note that the package does not match the directory hierarchy):
.../src/test/scala/model/GibberishTest.scala
Eclipse and gradle generate the coresponding class files:
bin/model/x/y/GibberishTestSuite.class
build/classes/test/model/x/y/GibberishTestSuite.class
This runs fine through gradle, but when I try to run in eclipse, I get
Class not found model.GibberishTestSuite
java.lang.ClassNotFoundException: model.GibberishTestSuite
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
If I change the package to
package model
so that the directory hierarchy and the package name match, then I am able to run the unit test in eclipse. In scala, it is legal for the package structure and the directory structure not to match. However, the mismatch seems to be confusing eclipse or the plugin.
Am I doing something wrong? Am I missing some configuration nuance? Is this scala language feature not supported in eclipse? Will it be supported at some point?
Thank you.
This is an Eclipse (JDT) problem rather than a Scala/scala-ide problem.
There was a bug raised against Eclipse (Package Explorer tree does match declared package), but basically, Eclipse assumes that the hierarchy matches the package names. This will be fixed eventually in the Scala-ide, but the model needs to be changed, to remove the dependency on the JDT. If you want this fixed, it's a good idea to add your vote to the above issue.

Intellij idea unresolved symbol in grails + gwt project

I have a grails project and I use the gwt plugin 0.6.1. GWT version is configured using ivy.
I have a strange unresolved symbol error when I try to use a class in package com.google.web.*. When I use the complete class names inline idea reports that it cannot resolve the web package. If I import the same class no error ocurres.
I already tried to run grails clean and removed the idea system directory as well - nothing works.
Idea usally import the class when I use smart complete but in this case idea insert the complete classname instead of importing the class.
The web package is found in the gwt-users-2.4.0.jar and gwt-servlet-2.4.0.jar. Both jars are in the classpath but this how the grails gwt plugin organizes gwt dependency.
Error when using full inline claasnames:
No error when using same class in import statement:
Does anyone have an idea?
Fixed already http://youtrack.jetbrains.net/issue/IDEA-81056
Fix is included in the next IDEA 11.1 EAP
http://confluence.jetbrains.com/display/IDEADEV/IDEA+11.1+EAP
I also had similar issue with IntelliJ IDEA, I solved problem by invalidating the idea cache. After invalidating the cache it will reindex all your library and other files. check this answer as well. Grails and IntelliJ Cache Issues