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
Related
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 ...
I have a Intellij plugin project that I can successfully build without using the PsiMethod class. I've generated this project using this intellij plugin guide
As soon as I add in code using PsiMethod class
(from the Intellij SDK code_samples directory)
The intellisense cannot find any GOTO information for the class.
I can then switch my project settings module from JAVA_1.8.0 to
by adding it into the platform settings SDKs:
This now adds intellisense, and gives me the ability to navigate to the PsiMethod class by CMD+click.
However, If I try and run my "plugin" gradle configratuion. it halts with an error running :runIde.
Running compileJava command from bash I get:
$ ./gradlew compileJava
> Task :compileJava FAILED
/Users/cody/IdeaProjects/plugintest/src/main/java/com/plugintest/TestClass.java:104: error: cannot find symbol
PsiMethod containingMethod = PsiTreeUtil.getParentOfType(element, PsiMethod.class);
^
symbol: class PsiMethod
location: class ParticleContainerManager
/Users/cody/IdeaProjects/plugintest/src/main/java/com/plugintest/TestClass.java:104: error: cannot find symbol
PsiMethod containingMethod = PsiTreeUtil.getParentOfType(element, PsiMethod.class);
^
symbol: class PsiMethod
location: class ParticleContainerManager
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
The gradle source sets in intellij are as follows:
And when I CMD+Click the PsiMethod class, it shows the following JAR source:
This source is in the following parent folder:
How can I add this source into my gradle configuration? shouldn't it be autodetecting what my projects intellisense is tapping into?
Do I need to change something in the gradle.* files inside the project directory?
EDIT:
Using Yann's Answer:
I've added the following line to my build.gradle file:
intellij {
version '2019.2'
plugins 'java'
}
and it works!
Please make sure to add Java plugin as separate dependency. This is now necessary starting with 2019.2: https://blog.jetbrains.com/platform/2019/06/java-functionality-extracted-as-a-plugin/
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
Setup / Problem
I've create a custom Android module for Titanium to display Gif animations inside Ti. The module source code can be found here:
https://github.com/m1ga/com.miga.gifview
The actual module is working fine but when I use it with a second module (with the same problem) I receive the following error:
java.util.zip.ZipException: duplicate entry:
org/appcelerator/titanium/gen/bindings.json
The problem is inside the gifimageview.jar file:
My two modules each have a bindings.json file inside the /gen folder that contains the same information as the bindings/gifview.json. So if I remove it manually in one module I can use both modules (because there is only one bindings.json now).
Question
How can I advise the compiler not to create this file or change the name? When I compile the module with ant I see this in the output:
compile:
[javac] Compiling 3 source files to /home/miga/dev/ti.gif/android/build/classes
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.6
[javac] Note: [KrollBindingGen] Running Kroll binding generator.
[javac] Note: [KrollBindingGen] Succesfully loaded existing binding data: /home/miga/dev/ti.gif/android/build/classes/org/appcelerator/titanium/gen/bindings.json
[javac] Note: [KrollBindingGen] Found binding for proxy GifView
[javac] Note: [KrollBindingGen] Found binding for module Tigifview
[javac] Note: [KrollBindingGen] Generating JSON: file:/home/miga/dev/ti.gif/android/build/classes/org/appcelerator/titanium/gen/bindings.json
[copy] Copying 1 file to /home/miga/dev/ti.gif/android/build/classes
There it is creating the bindings.json
What I've tried
Adding
org.eclipse.jdt.apt.processorOptions/kroll.jsonFile=migagifview.json
to the settings file: https://github.com/m1ga/com.miga.gifview/blob/master/android/.settings/org.eclipse.jdt.apt.core.prefs
didn't work
My setup
javac -version: javac 1.8.0_91
CLI version 5.0.6
Titanium SDK version 5.2.2.GA
Android-23
This was a confirmed bug and is fixed in 6.1.0
Issue details:
https://jira.appcelerator.org/browse/TIMOB-23502
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