I having trouble on the setup of drools I already tried this tutorial to setup my drools and it seems doesn't work for me then what i tried next is to go to marketplace and install the plugin from there, from there I'm able to open the perspective that means i already install the plugin on my eclipse.
Not I'm trying to create a drool project to see the example included to the project but the project doesn't have the Drool Library
That also make the imports to error, what am i doing wrong?
If you followed the tutorial, chapter 8.2, normally the Drools plugin would add the Drools library to your new rule project.
If that doesn't work, you can always add the Drools library to the build path of your project via Eclipse. Right click on your project -> properties -> Java Build Path -> tab Libraries -> Add library (or add external jar and add the Drools.jar's manuallly)
Related
I have a new Android project that I am trying to build with Maven.
I was able to download and import the project in Eclipse, but I am unable to generate a new class inside the the src directory.
The warning I get from File -> New -> Class is : Source folder is not a Java project.
I found a couple of solutions on the internet, saying that it is necessary to include Java from the project facets, but there is no Java option on the tab.
Any solution to this? I am working on Arch Linux.
The solution is adding the Maven Java EE plugin to Eclipse. I found this by typing "facets" in the Market Place search field. This plugin came up and I gave it a go. Luckily, it worked.
After this, you can find several options in project facets. Choose Java :
Properties -> Project Facets -> Java
This site here pointed me into the right direction and explains the process in more detail: Source Folder is not a Java Project
I've been trying to set up a new Kotlin project in IntelliJ IDEA, using the default IntelliJ Build System (not Gradle) and JDK 15. Whenever it creates the default main.kt file, and I try to build and run the main function, which looks like this:
fun main(args: Array<String>) {
println("Hello World!")
}
the build fails after a short time with the following errors:
Kotlin: Cannot access built-in declaration 'kotlin.Array'. Ensure that you have a dependency on the Kotlin standard library
Kotlin: Cannot access built-in declaration 'kotlin.String'. Ensure that you have a dependency on the Kotlin standard library
and
Kotlin: Unresolved reference: println
I've tried changing the project SDK to the kotlin SDK, to Java 14 and to Java 1.8. I'm not sure exactly how to add the dependency it asks for. Any help is appreciated.
This is what the dependencies window shows within the project:
Right now the project is using JDK 15, and Kotlin 1.4.10. I've tried updating the plugin, uninstalling and reinstalling, deactivating and reactivating, all to no avail.
The project files can be found here on Google Drive
Try enabling KotlinJavaRuntime
Open Project Structure window (File > Project Structure)
Go into Modules
Go to Dependencies tab
Tick the Enable KotlinJavaRuntime checkbox
Removing the .idea/library file inside the project directory and then selecting "use library from plugin" when prompted to configure Kotlin files by the IDE solved the problem.
Please provide more information and check what Kotlin version do you have installed:
Tools > Kotlin > Configure Kotlin Plugin Updates: install the latest version of Kotlin
File > Project Structure > Project: what is your Project SDK there? Choose 15 (something line java version "15.0.1"). If you don't have 15 there, click "+" and add the newest version (unless you need an older version).
Probably you need to add KotlinJavaRuntime library in you project. Please see paragraph "Create Kotlin files in Java projects" in https://www.jetbrains.com/help/idea/mixing-java-and-kotlin-in-one-project.html
After configuration you should see needed jars in lib folder in your project. Rebuild you project. Make also File->Invalidate Cache/Restart.
I tried all of the above but eventually found out, that in one project, my SDKs were completely broken after the newest Intellij Update. If you go to Project Structure -> Platform Settings -> SDKs, I had an entry for Kotlin with a non existing path for an Intellij Version of last year. This was definitely not there before and it seems to have messed up the kotlin installation. After i deleted that entry and as described above the libraries as well, it worked again.
For me this helped:
Close the project
Delete idea. folder
Open project
I have a Ubuntu 16.04 with IntelliJ 2020.3 newly installed. I run to the same issue here.
To solve this issue, I made a new kotlin file in my project. Then when the system was trying to add this new Kotlin file, you can find a notification related to "Configure project" on the right bottom corner of screen, click the notification. I get the following dialog.
Then check the Use library from plugin, this solve the issue.
Use library from plugin
In this case, it was a misconfigured IntelliJ instance.
Project Structure -> SDKs -> kotlinSDK -> + -> ok
rebuild will be work fine
In my case the Kotlin Standard Library JDK extension was missing. https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib-jdk8
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>1.7.21</version>
</dependency>
When selecting a user library as the JPA implementation in Eclipse Dali's project settings, the following error message is displayed:
The class 'javax.persistence.Convert' is required to be in the selected libraries
But the class javax.persistence.Convert is correctly included in the classpath of my user library, so how can this problem be resolved?
This error message may arise, when the persistence jar file of the selected user library is part of your Eclipse project folder (for example in a subdirectory of the project). Eclipse Dali doesn't find the class in this case.
If you try moving this directory out of the project folder and try again, it may work.
It might be a bug.
Download Eclipse Link 2.X.Y (Version 3.x.y seems to have different libs)
From the Download use the libraries / jars
eclipselink/jlib/eclipselink.jar
eclipselink/jlib/jpa/jakarta.persistence_X.Y.Z.jar
And place them into your user Library by either
The "Manage Libraries ..." Button on the very right of your screenshot
or
Eclipse -> Windows -> Preference -> Java -> Build Path -> UserLibraries
First download eclipseLink zip file https://www.eclipse.org/downloads/download.php?file=/rt/eclipselink/releases/3.0.2/eclipselink-3.0.2.v202107120736-2a0820a817.zip
Unzip file downloaded in folder eclipse for example.
From Eclipse -> Windows -> Preference -> Java -> Build Path -> UserLibraries
Click to new -> write, eclipseLinkx.x.x Where x.x.x is the version of eclipseLink downloaded.
After, select eclipseLink and click in Add External Jars. In this step add all jars that contain of .zip eclipseLink downloaded.
Previously download library javax.persistence.Convert you can find to Google.
When download javax.persistence.Convert go back to eclipse and add library javax.persistence.Convert to eclipseLink library added.
Now, you can create projects JPA.
It seems your Eclipse doesn't have the Javax driver in it, so you have to download Javax library and add it in your project.
I had this problem and It worked for me.
download the latest version from here https://jar-download.com/artifacts/javax
I am going through The Eclipse Debug Framework tutorial which was presented at Eclipse con 2005 (https://www.eclipsecon.org/2005/tutorials.html). The Zip file (which can be downloaded from the link) contains 7 exercises. For each exercise an initial code base consisting of two plug-ins is provided - example.debug.core and example.debug.ui.
I tried to import these projects as Plugin and fragments but it doesn't work. (These Projects are not shown as Plugin Projects in the Dialog)
So then I decided to import these projects as Java Projects by "File > Import > Existing Project into Workspace" but then I can't seem to convert them to PDE Projects. I tried it by following these instructions here.
I am trying to convert these Projects to Plugin Projects because otherwise I can't seem import plugins to the Java classes in these projects
even though I have already added these plugins as Dependencies..
So any Ideas? I am using Eclipse Modeling Tools (Luna). In tutorial they recommend using Eclipse SDK, version 3.1M5.
'Import > Existing Projects into Workspace' works for me.
For the 'root directory' choose the 'exercise1.1' directory. The two projects should then be listed in the projects list.
But these projects are 10 years old and are using the old style plugin.xml format which is not supported by default by current Eclipse builds. This results in lots of import errors.
Thanks, now it works. This is what I did.
Open plugin.xml file in the editor and Navigate to Overview Tab. There under the section Plugin Content you would find an option to Create an OSGi Bundle Manifest OR if there is no such option then a Message asking you to either write a Manifest.MF file manually or to first install Eclipse 2.0 style plugin support. (Help> Install New Software, use this update site http://download.eclipse.org/eclipse/updates/4.4). You will find 'Eclipse 2.0 Style Plugin Support' in the 'Eclipse Tests, Examples and Extras' section.
checkout this link for more info (Tools for Eclipse 2.0 plugins upgrade)
Once installed old plugins can run and also a Create OSGi Bundle Manifest option will appear under Plugin Content section if it wasn't there earlier...
I am using Eclipse to develop an Android board game.
I have developed the UI in an Android project.
On the other hand, I have developed the AI in a regular Java project, because I wanted to be able to test it without all the constraints of the Android emulator (I didn't find any other way to run the code using my Windows JVM).
Now comes the times when I want to 'join' both projects (which work fine independently), that is to use the AI Java classes from the UI.
This is what I have tried:
In my Android project Properties > Projects References, I ticked the Java project.
This allows me to build without error the Android project (which instantiates an AI object).
But it fails at runtime with this error:
Could not find class 'my.package.AI', referenced from method my.otherpackage.UI.onStart
What would be the correct way to include the AI Java Project into my Android Project ?
(NB: I still want to be able to develop and test the AI as a regular Java app, so I think using a jar or copying all the sources to the Android Project would not suit my needs)
EDIT:
I was hoping that the new ADT v17 would solve the problem, but it didn't. I have tried virtually every option available to include a project in my Android project:
Adding or linking a source folder
Adding a Project (Java Build Path > Projects tab)
Adding a Class Folder or a Library (Java Build Path > Library tab)
Ticking all the previously imported projets/libraries as Exported
The only way that allows compiling and running without error is adding the JAR of the Java Project to the Android project build path.
Projects References only add the dependent project source code (your AI project) as a soft (perhaps weak is a more accurate word) reference, your AI project is not added into you Android Project Build path. so the actual ai.jar is not exported into the final apk when Eclipse build your app.
You should add AI project into Android project build path:
Right-click on your android project, select Build Path - Configure Build Path, in Projects tab (Required projects on the build path), add your AI project here.
Then in Order and Export tab (Build class path order and exported entries), tick your newly added AI project appeared int the list.
Step 2 is probably optional, this should add AI project as a reference in Android project and export the ai.jar to final.apk when Eclipse build your Android project.
Update from ADT 17.0.0:
Android Dev Team just release SDK r17 with ADT 17.0.0, which claims to handle this use cases properly now:
Eclipse specific changes
The dynamic classpath container called “Library Projects” has been renamed to “Android Dependencies” as it now contains more than just Library Projects.
The container will now also be populated with Java-only projects that are referenced by Library Projects. If those Java projects also reference other Java projects and/or jar files they will be added automatically (jar files referenced through user libraries are supported as well).
Important: this only happens if the references are set to be exported in the referencing project. Note that this is not the default when adding a project or jar file to a project build path.
Library Projects (and the content of their libs/*.jar files) is always exported. This change only impacts Java-only projects and their own jar files.
Again, duplicates (both projects and jar files) are detected and removed.
More in this link.
Edit: After much testing, reading and found my solution. Problem is (as of this writing) that you can't reference another project from an Android project, although it works fine for a normal Java application project.
Workaround for me (Windows with NTFS filesystem):
In a prompt (admin rights) make a symbolic folder link using mklink /D command pointing to your source project folders, and refresh in Eclipse as needed.
The obvious limitation is you cant use the same package names in source project and target project, and then there is the problem with libs in the common project.
example:
cd \java\workspace\AndroidProject\src\your\package
mklink /D common c:\java\workspace\CommonProject\src\your\package\common
Clarification: You can reference another project from an Android project to make it compile, however when you run, the referenced classes from the included project are not put in the apk classes.dex (verified with dex decompiler).
Using ADT 21.0.0 64bit on Windows 7 64bit. I tried adding project to build path. Ticked in the Order and Export, played with order. I read the official solution, the detailed explanation of that solution, exported as JAR, added to libs. Did not work, while the source was without errors. Read in the comments that the solution didn't work for everyone.
Was fed up with it and tried a simple but somewhat messier solution: linked the Java project's source to the Android project. That did the trick. Hope that this will help others too.
Don't add it to the project references area, instead go into the Android pane (in the Project Properties), scroll down to the bottom, and add it under Libraries.
This sometimes works but sometimes produces bizarre Eclipse issues (not sure why), in which case copying the jar directly into the project seems to work best.