I am developing an application using Spring Boot. It is fairly straightforward. It uses Quartz to schedule Pentaho jobs to import data into a Postgres database. It contains only 1 module(the original, no extras have been added. The project started out using Java 7 but within the first couple of weeks switched to Java 8. After the switch, everything ran fine(i.e the application would compile and launch). I started coding some new classes and when they were completed, I went to test them and the application wouldn't compile. I got an error stating that Java 8 was the wrong source code. I checked my project structure and both Global and Module compilers were set to Java 8. I did find that Gradle was still using Java 7. I changed Gradle to Java 8 and the error changed. The compile was still failing due to the following errors:
• error: package org.quartz does not exist import org.quartz.*;
• error: package org.quartz does not exist import org.quartz.*;
• error: package org.quartz does not exist import org.quartz.*;
• error: package org.quartz.impl does not exist import org.quartz.impl.StdSchedulerFactory;
• error: package org.quartz.impl.matchers does not exist import org.quartz.impl.matchers.GroupMatcher;
• error: package org.pentaho.di.job does not exist import org.pentaho.di.job.JobMeta;
• error: package org.pentaho.di.core.exception does not exist import org.pentaho.di.core.exception.KettleException;
• error: package org.pentaho.di.core does not exist import org.pentaho.di.core.Result;
• error: package org.pentaho.di.core does not exist import org.pentaho.di.core.KettleEnvironment;
Quartz and Pentaho are not being found even though they are set up in the Project Structure:
I am fairly new to IntelliJ so any suggetions on what else to check or how to proceed would be greatly appreciated.
This can solve your problem. First clean your gradle project. After that you will need to refresh all your gradle deps by clicking on this blue arrows in gradle tool window.
I am not sure if you found a solution, but I was experiencing a similar situation. I tried to remove current modules in the project settings, then added the project modules again. I then refreshed my Gradle and rebuilt my project.
Related
When a make a simple test program with Logitech's LED SDK and run it, I get an UnsatisfiedLinkError with the message:
C:\Users\cwa38\AppData\Local\Temp\LogitechLedJNI.dll4587977834410494064: Can't find dependent libraries
What I have done so far:
I downloaded the SDK from https://www.logitechg.com/en-us/innovation/developer-lab.html
I extracted it
I made a new Java project in NetBeans
I added the logiled.jar file to my new project as a dependency
I made a new class and copied the simple test program from the documentation (code is below)
I clicked "run" and got the UnsatisfiedLinkError described above
I see that the SDK download comes with some .dll files and a .lib file, but I have no idea what to do with these files. The included documentation makes absolutely no mention of them.
What am I doing wrong?
Here is my code:
import com.logitech.gaming.LogiLED;
public class Main {
public static void main(String[] args) {
LogiLED.LogiLedInit();
LogiLED.LogiLedSetLighting(100, 0, 0);
LogiLED.LogiLedShutdown();
}
}
And here is the full documentation from Logitech (yes, it really is this short):
The following steps show how to make the Logitech SDK work with a Java program. Please adapt the steps to your game for things to work.
Steps
Copy the SDK’s Lib\logiled.jar to your project’s directory.
Configure your project’s Java Build Path to include the logiled.jar.
Call the functions from the JNI wrapper in your Java code as follows:
import com.logitech.gaming.LogiLED;
LogiLED.LogiLedInit();
LogiLED.LogiLedSetLighting(red,blue,green);
LogiLED.LogiLedShutdown();
Compile and run your program.
The full stack trace for the error I get is below:
Exception in thread "main" java.lang.UnsatisfiedLinkError: C:\Users\cwa38\AppData\Local\Temp\LogitechLedJNI.dll4587977834410494064: Can't find dependent libraries
at java.base/jdk.internal.loader.NativeLibraries.load(Native Method)
at java.base/jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open(NativeLibraries.java:384)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:228)
at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:170)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2389)
at java.base/java.lang.Runtime.load0(Runtime.java:755)
at java.base/java.lang.System.load(System.java:1953)
at com.logitech.gaming.LogiLED.<clinit>(LogiLED.java:205)
at javaapplication1.JavaApplication1.main(JavaApplication1.java:20)
C:\Users\cwa38\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:111: The following error occurred while executing this line:
C:\Users\cwa38\AppData\Local\NetBeans\Cache\12.4\executor-snippets\run.xml:68: Java returned: 1
I tried to run your project in my netbeans but failed with
project com.cwa380:KeyColors:jar:1.0: logitech:gaming:jar:9.00 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced
then I created a new project from ant, as long as you are using this logitech jar which is not really in maven repository, you dont need to have maven project.
then I added the logiled.jar as image below
good news when I run the code I get no exception. output below
and when I try to use code completion netbeans lists the functions nicely.
here are my versions of tools
Product Version: Apache NetBeans IDE 12.4
Java: 17; OpenJDK 64-Bit Server VM 17+35-2724
Runtime: OpenJDK Runtime Environment 17+35-2724
System: Windows 10 version 10.0 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\ozkan\AppData\Roaming\NetBeans\12.4
Cache directory: C:\Users\ozkan\AppData\Local\NetBeans\Cache\12.4
in github I found https://github.com/larsgrefer/logi-led you may contact with Lars(#larsgrefer), looks like he knows how to use logitech SDK.
here is my project https://github.com/ozkanpakdil/spring-examples/tree/master/JavaApplication1 make sure you have added logiled jar in correct path to libraries
I'm trying to use jdk.crypto.cryptoki/sun.security.pkcs11.wrapper.PKCS11 in IntelliJ, but for some reason it keeps throwing errors. It seems like it's unable to detect this package. One of the solutions was to add --add-exports jdk.crypto.cryptoki/sun.security.pkcs11.wrapper=ALL-UNNAMED in the settings, which I did, but now it throws a compile time error in the IDE:
Error:(5, 20) java: package sun.security.pkcs11 is not visible
(package sun.security.pkcs11 is declared in module jdk.crypto.cryptoki, which is not in the module graph)
I'm using Java 11. It works fine when I try to compile and run it over the terminal
I want to build a REST Service with Java Spring and followed this guide successfully.
After creating a new gradle project i copied the build.gradle file and started everything with gradle buildRun. It is all woring well, except that Eclipse underlines imports, variable declararations, standard
datatypes as unresolveable.
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
#SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
For example are in this class String, SpringApplication, SpringBootApplication, Application and org.springframework marked as unresolvable. However Exlipse resolves them just fine. I hope someone can
tell me what i have to change, error detection is quite hard right now (:
The platform is:
Eclipse IDE for Java Developers
Version: Oxygen.3a Release (4.7.3a)
Build id: 20180405-1200
OS: Linux, v.4.16.13-2-ARCH, x86_64 / gtk 3.22.30, WebKit 2.20.3
I had this issue before with Spring (although it was with with Maven) and I was able to resolve it by updating my Maven project and running a clean build. Check and see if it possible to "refresh" your gradle build/update dependencies:(For me it was Right-click -> Maven -> Update Project), and also try running gradle clean first, then build it to see if leftover artifacts are causing the issue.
If you get a "Could not find or load main class" or an error like that from Spring later, make sure your directory structure (from the project) is src/main/java/hello, with hello being the package containing your class files.
Which JAR contains org.jboss.netty.channel.socket.nio?
I'm not using Maven or Ivy, just Ant.
Ant compile gives:
-do-compile:
[javac] Compiling 4 source files to /home/thufir/NetBeansProjects/EchoClient/build/classes
[javac] /home/thufir/NetBeansProjects/EchoClient/src/net/bounceme/dur/netty/client/ObjectEchoClient.java:3: error: package org.jboss.netty.channel.socket.nio does not exist
[javac] import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory;
In the classpath is:
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$ head -n 58 project.properties | tail -n 29
endorsed.classpath=
excludes=
file.reference.netty-all-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/all-in-one/netty-all-4.0.21.Final-sources.jar
file.reference.netty-all-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/all-in-one/netty-all-4.0.21.Final.jar
file.reference.netty-buffer-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-buffer-4.0.21.Final-sources.jar
file.reference.netty-buffer-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-buffer-4.0.21.Final.jar
file.reference.netty-codec-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-4.0.21.Final-sources.jar
file.reference.netty-codec-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-4.0.21.Final.jar
file.reference.netty-codec-http-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-http-4.0.21.Final-sources.jar
file.reference.netty-codec-http-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-http-4.0.21.Final.jar
file.reference.netty-codec-socks-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-socks-4.0.21.Final-sources.jar
file.reference.netty-codec-socks-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-codec-socks-4.0.21.Final.jar
file.reference.netty-common-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-common-4.0.21.Final-sources.jar
file.reference.netty-common-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-common-4.0.21.Final.jar
file.reference.netty-example-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-example-4.0.21.Final-sources.jar
file.reference.netty-example-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-example-4.0.21.Final.jar
file.reference.netty-handler-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-handler-4.0.21.Final-sources.jar
file.reference.netty-handler-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-handler-4.0.21.Final.jar
file.reference.netty-tcnative-1.1.30.Fork2-linux-x86_64.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-tcnative-1.1.30.Fork2-linux-x86_64.jar
file.reference.netty-tcnative-1.1.30.Fork2-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-tcnative-1.1.30.Fork2-sources.jar
file.reference.netty-transport-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-4.0.21.Final-sources.jar
file.reference.netty-transport-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-4.0.21.Final.jar
file.reference.netty-transport-rxtx-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-rxtx-4.0.21.Final-sources.jar
file.reference.netty-transport-rxtx-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-rxtx-4.0.21.Final.jar
file.reference.netty-transport-sctp-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-sctp-4.0.21.Final-sources.jar
file.reference.netty-transport-sctp-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-sctp-4.0.21.Final.jar
file.reference.netty-transport-udt-4.0.21.Final-sources.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-udt-4.0.21.Final-sources.jar
file.reference.netty-transport-udt-4.0.21.Final.jar=/home/thufir/jars/netty-4.0.21.Final/jar/netty-transport-udt-4.0.21.Final.jar
includes=**
thufir#dur:~/NetBeansProjects/EchoClient/nbproject$
The library is netty-4.0.21.Final.tar.bz2, which was downloaded from the official Netty website.
I added each JAR from that download to the project. Yes, I realize it's not using the CLI javac classpath, but the JAR's are visible in the project, as well as in the output above.
I looked through some of the JAR's and was unable to find this specific class.
You seem to be trying to build an application developed against Netty 3.x using Netty 4.0.
There have been API changes, including channel creation and bootstrap. Also, the package prefix changed from org.jboss.netty to io.netty reflecting the project status change.
Use the API documentation (which no longer documents NioClientSocketChannelFactory) corresponding to the release you're using and checkout the provided examples (netty-example-4.0.21.Final-sources.jar) to help port any code you have that's built against Netty 3.x.
I am developing a Java project using Eclipse. The project uses another project called engine, which I have added in my project build-path. As I need to call a dabo class, called House, in one of my project class, named Window, I have used the following code as usual:
import ee.asus.kernel.House;
I got however the following error in compiling time:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The import ee cannot be resolved
House cannot be resolved to a type
House cannot be resolved to a type
House cannot be resolved to a type
at main.ee.asus.GUI.FrameWindow.Window.<init>(Window.java:10)
at main.ee.asus.GUI.StartApplication.main(StartApplication.java:13)
It's worth to point out that my prject and the dabo project use the same directory/packages names. Does anyone have a clue where the error may be?
The error can't resolve the first part of the package name: ee. Are you sure the package starts with ee? I see your Window class package starts with main.ee, does your engine project start with the same package structure?
I sometimes get weird behaviour with missing class files etc. when Eclipse is out of sync with the filesystem.
You could try refreshing all of your projects and doing a full rebuild.
I have been experiencing the same problem. I have an app A1(tablet version app) calling another app A2(phone version app). Upon calling, I see the same error message:
java.lang.Error: Unresolved compilation problems:
The import xxxxx cannot be resolved
xxxx cannot be resolved to a type
xxxx cannot be resolved to a type
xxxx cannot be resolved to a type
After poking around for a while, I realized the problem was the A2 doesn't run on tablet at all. It's weird because the immediate previous version of A2 runs perfectly on the same tablet(I have been on board only for 1 month). So I decided there was something wrong in the build config.
Finally, I fixed the problem by changing the order of Java Build Path. Although I have no idea why it worked, hopefully this will shed some light on your problem.
Look for the House class in your second project, opens it and see what package it is in.
(line "package xxx.yyy.zzz;" at the beginning of the House.java file)
Then make sure your Window.java file (class main.ee.asus.GUI.FrameWindow.Window) does have the line "import xxx.yyy.zzz.House;" in it.
In my case it was a version conflict.
I'm using maven and updated many packages and bumped versions of many projects. Maybe the reactor built mixed something up, or the transitive dependencies weren't up-to-date, or it was a change in a project without a version increment. However, rebuilding that project explicitly via maven fixed the problem.
Edit: When I think about it, it might also have been a conflict between eclipse's auto-build and building via maven on the command line.