I get a compile error with JerseyClientBuilder - java

I am using IntelliJ.
I have added the JAR - https://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-client/2.0-m04
To my project,
{{ import org.glassfish.jersey.client.JerseyClientBuilder; }}
despite this I still get a compile error .
Error:(3, 35) java: cannot find symbol
symbol: class JerseyClientBuilder
location: package org.glassfish.jersey.client
I did have a lot of errors due to missing JARS , but I just found them on the web and added them to the project under project structure and that sorted all the errors except for the jersey Client Builder ...

Related

I'm not able to use an external library in Java

I'm having trouble adding a .jar externally, notice that the .jar in the correct location, apparently has been added to the project, is ms-azure-cs-faceapi.jar, I added by clicking on add external JARs.
I'm using this library in a class only, and after adding it to the path the errors are gone, there are no errors in the system, at least red dots are not appearing in any folder, apparently everything is all right.
However, when I run the "clean install" appear these errors in the console:
[ERROR]/I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[26,67] package com.microsoft.azure.cognitiveservices.vision.faceapi.models does not exist
[ERROR] /I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[190,31] cannot find symbol
[ERROR] symbol: class FaceAPI
[ERROR] location: class TestFaceapi
[ERROR] /I:/system/execs/eclipse/test/src/main/java/TestFaceapi.java:[239,38] cannot find symbol
[ERROR] symbol: class FaceAPI
[ERROR] location: class TestFaceapi
As I said, in the class there is no error, everything is ok, but I can not climb the application due to this error ... does anyone have an idea of what might be missing when importing .jar externally?

DataBinding Error in Gradle Build- Android Gradle 3.2

Currently i am trying to upgrade my project into the android x but before that i was done the gradle wrapper 4.10.1 and tools.build:gradle:3.2.0 but i am getting the following error and all my code in java only.
Anybody knows how will resolve these kind of issues.
> Task :app:dataBindingGenBaseClassesProjectMDebug
> Task :app:compileProjectMDebugJavaWithJavac FAILED
E:\SVN\Hindi_v_28_Final_AndroidX\BM-6.3_v28\app\build\generated\data_binding_base_class_source_out\ProjectMDebug\dataBindingGenBaseClassesProjectMDebug\out\com\ProjectMs\databinding\ActivityAddDetailPopupBinding.java:16: error: cannot find symbol
import com.ProjectMs.viewmodel.AddDetail;
^
symbol: class AddDetail
location: package com.ProjectMs.viewmodel
E:\SVN\Hindi_v_28_Final_AndroidX\BM-6.3_v28\app\build\generated\data_binding_base_class_source_out\ProjectMDebug\dataBindingGenBaseClassesProjectMDebug\out\com\ProjectMs\databinding\ActivityAddDetailPopupBinding.java:129: error: package AddDetail does not exist
protected AddDetail.AddDetailViewModel mViewModel;
^
E:\SVN\Hindi_v_28_Final_AndroidX\BM-6.3_v28\app\build\generated\data_binding_base_class_source_out\ProjectMDebug\dataBindingGenBaseClassesProjectMDebug\out\com\ProjectMs\databinding\ActivityAddDetailPopupBinding.java:183: error: package AddDetail does not exist
public abstract void setViewModel(#Nullable AddDetail.AddDetailViewModel viewModel);
In Android Plugin 3.2.0 and above, the databinding V2 is enabled by default. I guess the databinding V2 compiler treats any component that starts with an upper case letter as a class, not a package
After change the lower case its works well like "adddetail" instead of "AddDetail".
import com.ProjectMs.viewmodel.adddetail;
Thanks. Refer url
Gradle Plugin 3.2.0 with databinding, can not resolve package name

How do you add 'org.eclipse.core:org.eclipse.core.runtime:3.7.0' library to Intellij ant build

I can resolve the compile 'org.eclipse.core:org.eclipse.core.runtime:3.7.0' in gradle but instead using ant with the Intellij idea. I've included the org.eclipse.core.runtime-3.7.0.jar in my libs folder. I get the following errors.
Error:(22, 32) java: cannot find symbol
symbol: class IProgressMonitor
location: package org.eclipse.core.runtime
Error:(23, 32) java: cannot find symbol
symbol: class IStatus
location: package org.eclipse.core.runtime
Error:(24, 32) java: cannot find symbol
symbol: class Status
location: package org.eclipse.core.runtime
I'm attempting to build Android's UIAutomatorView, if I put the code into Android Studio it seems to resolve IProgressMonitor, etc. with compile 'org.eclipse.core:org.eclipse.core.runtime:3.7.0' in gradle.
Here's a screenshot of my project structure and source error.
Is there an easy way to add this to ant or just convert the project to gradle (detailed steps please).
You should have a build.xml file for your project. Look for the javac task (within the build file) that's being used to compile your code and make sure your jar is in the class path defined in there. If it's not, just copy it in.
Example taken from the below link:
<javac srcdir="${src}"
destdir="${build}"
includes="mypackage/p1/**,mypackage/p2/**"
excludes="mypackage/p1/testpackage/**"
classpath="YOUR_REQUIRED_JAR_FILE_HERE.jar"
debug="on"
/>
Source: https://ant.apache.org/manual/Tasks/javac.html

Spring app from eclipse to intellij

I have a Spring application that i did not started to build, these dudes made it old school way without maven or gradle support in eclipse.
I want to work on it in IntelliJ Idea, importing the project gives me the following errors:
Idea Event Log:
12:13:36 PM Unknown Natures Detected
Imported projects contain unknown natures:
org.eclipse.wst.common.modulecore.ModuleCoreNature
org.eclipse.wst.jsdt.core.jsNature
org.eclipse.jem.workbench.JavaEMFNature
org.eclipse.wst.common.project.facet.core.nature
Some settings may be lost after import.
Also when trying to build:
/home/.../src/com/.../controller/servlet/VideoServlet.java
Error:(7, 32) java: package javax.servlet.annotation does not exist
Error:(13, 2) java: cannot find symbol
symbol: class WebServlet
/home/.../src/com/.../service/CustomUserDetailsService.java
Warning:(10, 51) java: org.springframework.security.core.authority.GrantedAuthorityImpl in org.springframework.security.core.authority has been deprecated
/home/ldurazo/git/arcofi/arcofi/src/com/arcofi/controller/FileDownloadController.java
Error:(35, 40) java: cannot find symbol
symbol: method getServletContext()
location: variable request of type javax.servlet.http.HttpServletRequest
I have the library servlet-api2.3.jar
And in the project structure i have the following problems
Module project : invalid item 'org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0' in the dependencies list
Module project : invalid item 'org.eclipse.jst.j2ee.internal.web.container' in the dependencies list
Module project : invalid item 'org.eclipse.jst.j2ee.internal.module.container' in the dependencies list
And last, in project structure too:
Unknown facet type: 'Spring'
Unknow facet type 'Web'
I am using IntelliJ Idea 14 and Eclipse Luna

Unable to compile custom solr filter classes using javac

I am trying to build a jar for my custom filter in Solr 4.6. I am getting below error on running compile:
CustomFilter.java:19: error: package org.apache.lucene.analysis does not exist
import org.apache.lucene.analysis.TokenFilter;
^
CustomFilter.java:20: error: package org.apache.lucene.analysis does not exist
import org.apache.lucene.analysis.TokenStream;
^
CustomFilter.java:21: error: package org.apache.lucene.analysis.tokenattributes does not exist
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
^
CustomFilter.java:24: error: package org.apache.solr.util does not exist
import org.apache.solr.util.NumberUtils;
^
CustomFilter.java:43: error: cannot find symbol
public final class CustomFilter extends TokenFilter {
^
symbol: class TokenFilter
CustomFilter.java:46: error: cannot find symbol
private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class);
^
symbol: class CharTermAttribute
location: class CustomFilter
CustomFilter.java:47: error: cannot find symbol
private final PositionIncrementAttribute posIncrAtt = addAttribute(PositionIncrementAttribute.class);
I need some help regarding adding this custom filter to my schema. Without building this jar, I am getting below error on my solr admin if i try using the filter in the schema for a field:
org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Plugin init failure for [schema.xml] fieldType "textCustom": Plugin init failure for [schema.xml] analyzer/filter: Error instantiating class: 'org.apache.solr.analysis.Custom.CustomFilterFactory'. Schema file is /opt/solr5/collection3/schema.xml
There are duplicate questions to this but no correct answers. Hence please don't close this question on those basis.
looks like you are trying to compile your class file without pointing to correct dependencies, make sure you are pointing the classpath to the directory that contains your plugin in this case: org.apache.lucene.analysis.TokenFilter (also check your other dependencies) i.e: lucene-1.3.jar is in the same directory as where is the java file
javac -cp:<directory> <file to compile>
javac -cp:. <file to compile> //period means classpath is same library to compile
Also make sure your custom tokenizer library is in the solr library. check your schema.xml for the existing libraries and add your custom solr filter library in the same directory.

Categories