No Java code completion in VSCode in gradle project - java

I am trying to setup my VSCode to get proper code completion in this project: https://github.com/structurizr/java-extensions
I have the Java Extension Pack installed in my VSCode.
But it is not even recognized as a Java project. If I add every single "src" folder via "Add folder to java source path" the Java imports are recognized but the code completion is still not working.
Any hints on what is wrong or what I need to configure in my VSCode to make it work?
Thank you

Because this is a Gradle Project, In addition to Java Extension Pack, you should install Gradle Language Support.
Then reopen the project in VS Code, Gradle extension will download the required files to be able to build and compile the project. After all downloads finished, you can edit your project and auto-completion would work as normal:

Related

IntelliJ IDEA project modules are not auto identified on WSL

The files within my Gradle project are not identified by IntelliJ when a project in WSL (Windows subsystem for Linux) is opened by IntelliJ IDEA Ultimate. Correct java versions are also installed within WSL and the paths are also set correctly.
This is a Gradle project and my java files are shown with a red icon on them and it says "Java file outside of source root".
Then I went to File -> Project Structure -> Modules, and observed that the correct modules were not identified.
When I open the same project in Windows or Ubuntu, the modules are automatically detected and I don't need to add them manually.
How I opened the project is using File -> Open on IntelliJ for Windows and gave the project path within WSL (E.g. \\wsl$\Ubuntu-20.04\home\username\idea-project).
My Gradle versions is as below,
Has anyone come across any situation like this that could help me figure out what is the issue behind this.
Thank you.

Universal Eclipse plugin

I'm working for some time on improving a plugin for Eclipse for C/C++. In the IDE is is represented as an simple button inside the Tool Bar which is used to start an user interface. To integrate the script inside the IDE you only have to copy the .jar files inside the Eclipse/plugins folder.
At the moment I'm trying to make the plugin independent of the Eclipse IDE and it seems that I encounter some problems. I did the development in Eclipse Kepler and tested the plugin on Eclipse Kepler, Luna and Mars. It seems to be working as expected on these versions. Unfortunately it doesn't seem to work for Eclipse Neon.I copy the .jar file inside the plugin folder but when i run the IDE the button is not available inside tool bar as on the other versions.
Is there any constrain that I am missing? I already checked the dependencies of the plugin.It requires only 3 additional eclipse .jar files but those files are present inside the Eclipse/plugin folder.

Where is My Classpath in Windows?

Hello I am using IntelliJ Idea 13.0.1 and I downloaded the seaGlass LAF. The website instructed me to put it into my classpath but I have no idea where that is on my windows machine. I am not using a special package or anything. I'm just using the src folder and I tried putting the JAR file everywhere. No working. Can I get some help please. A SIMPLE classpath explanation would be good too.
By adding dependencies in IntelliJ you are in turn configuring the classpath of your application.
Create a java project in IntelliJ
Open the Project Structure | Module Dependency
Add your jar for seaglass LAF to the dependency list in the dialog
Add your java code to the project
Add the code for applying the seaglass LAF to your program
As you start your application the IDE will generate the java execution with the appropriate classpath. This classpath is created from the list of dependencies, one of which is your LAF. You can inspect the java program execution with the classpath parameter in the console output in the lower window in the IDE.
There are much better places than here to learn about what a classpath is.

Java project won't compile to a JAR correctly for Android

in an app I'm working on I have an issue with a Java library which is here - https://github.com/kennydude/Boid-Twitter-API
When I run ant android which builds an Android package it builds fine and Eclipse can read the Jar fine.
But on my device it says that dalvik cannot locate any of the classes and eventually throws a ClassDef Exception.
I have used Jars before, so I'm wondering if it's my ant file that's broken
I would open your app project in eclipse (the one that depends on the Java library that is not found at run-time) and add the jar file the Java library produced to its build path. Then execute
android -s update project -p .
in the same directory as your apps' Manifest.xml file in order do generate ant build files.
After this, you should be able to build your app using ant by doing
ant debug
or
ant release
I fixed it by ensuring Ant was compiling to 1.6 of Java which is my target in Eclipse for the application.
Perhaps you're not placing your jar in the libs directory as opposed to lib directory? Here's a similar issue Java (Android) - class not found exception
First of all to build an apk with ant for Android you have to use ant debug or ant release, i don't know what ant android does and why you are using it but this command is not part of the standard approach to ant for Android, that's for sure.
Ant is just a building tools, if a developer provide a building solution in ant, does not mean that his application is for Android.
Under Android everything that is not a native library is converted in a DEX object, which is something similar to bytecode for the Dalvik, there is no jar or other container in your app.
This question may be helpful for you Adding a library/JAR to an Eclipse Android project .
There are a lot of conceptual errors in this topic, you probably want to study the Android platform before using it.

How can I open non-Netbeans Java project using Netbeans?

I'm using Netbeans for my Java development, and every time I download a project that has been developed using other IDE, I can't run the project because of errors.
Is there any way to open regular people's projects easily without headache.
Note : the project am trying to open is not an Eclipse project, so I can't use the Eclipse importer.
And usually what are Java developers using for development?
Most Java developers are split between Eclipse , IntelliJ Idea and NetBeans. NetBeans is capable of opening Eclipse projects and Idea can export to Eclipse. So this should solve most problems.
Another way is to check if you project is using Maven or a similar model. Generally there are plugins for Netbeans that can handle import from this sort of sources.
I've had some luck using File > New Project… > Java > Java Project with Existing Sources, which "Imports an existing Java application into a standard IDE project. The Java application can have multiple source folders. Standard projects use an IDE-generated Ant build script to build, run, and debug your project." Conveniently, the generated script includes targets that can be overridden to alter the build process, as seen here.
We have several projects with existing ant build scripts and all I want is to have NetBeans as my code editor ...so far.
We aim for that the projects are independent of IDE as we have been used to just use emacs and ant for coding/building, which means that independant on platform you should be able to checkout the code and just build it no matter if it is within an IDE or just a shell/"DOS prompt". If you have projects like that use the "Java Free-Form project" and add all jars that you have defined in build script to also be included in Netbeans CLASSPATH.
This type of project will use your ant scripts for everything and will still work even if someone in your project prefer to use other coding environment.
Hope this can help

Categories