Idea cannot resolve java.sql.* symbol,notice cannot import - import

the idea cannot resolve java.sql.* symbole,below is i find problem.i install jdk with 1.8.0_181.
i have already tried using below actions. file->invalidate cache /restart,But the problem still exists
it is said the unused import
the rt.jar package in idea explorer,the jdk path is C:\Program Files\Java\jdk1.8.0_181\jre\lib
the rt.jar package in winrar explorer, the jdk path is C:\Program Files\Java\jdk1.8.0_181\jre\lib

You need to add mysql dependency to your project. If you are using the maven project, gradle ,sbt use this link and add it into your project.
https://mvnrepository.com/artifact/mysql/mysql-connector-java/8.0.12
If you are not using any of this above download mysql-connector-java jar manually and add it in class path.
you can download jar from here https://www.mysql.com/products/connector/

Related

how to import javax.mail in eclipse?

I am learning how to use JavaMail. (i have se11)
I downloaded javax.mail.jar,
put it under C:\Java\jdk , and extract it.
I followed the instruction, set CLASSPATH = C:\Java\jdk\javax.mail.jar ;
and I add the javax.mail.jar to the eclispe Referenced Library.
However, when i try to import javax.mail.* , it says the import can not be resolved.
I open the extracted folder, and it contains only .class files.
I tried to open the javax.mail.Session file from eclipse file explorer, but it said:
"The JAR file C:\Java\jdk\bin\javax.mail.jar has no source attachment."
what should I do in order to import the javax.mail.* ?
I am very frustrated, please help!
No matter how you run your program, to just use the classes in a jar you need to have the jar file in your classpath. If you run from the command line you can do this:
java -cp C:\Java\jdk\javax.mail.jar my.fully.qualified.classname
If you're in Eclipse then:
Import the jar file into your Java project. Use the File-->Import... action.
Select your java project and select Build Path --> Configure Build Path...
Select Java Build Path on the left
Select the Libraries tab and the Add Jars... button on the right
Navigate to and select the jar you you imported above
Click OK
The classes in the jar file are now available for use in your code.

openfire build install4j jar file

I am trying to build openfire from the source code. getting compile time error. below classes not found.
import com.install4j.api.Context;
import com.install4j.api.ProgressInterface;
import com.install4j.api.UninstallAction;
from where we can download these jar files. tried
https://mvnrepository.com/artifact/com.install4j?sort=newest
all the jar file still does not work. Any idea.
Thanks
Mohsin
The install4j artifacts are available from the repository
https://maven.ej-technologies.com/repository
See https://www.ej-technologies.com/resources/install4j/help/api for more information.

The package org.openqa.selenium is accessible from more than one module

I'm using:
Firefox 56.0.1
Selenium 3.6.0
Windows 10 home edition
Gecko Driver 0.19.0
The error message is
The package org.openqa.selenium is accessible from more than one
module: client.combined, net.bytebuddy"
This happens when you have added the external jars in the ModulePath.
Solution:
Remove the external jars from the node "Modulepath".
Select the node "Classpath" then add the external jars.
Review that all the jars are under the node "Classpath".
The problem is that you are adding .jar files to your Modulepath instead of Classpath.
Go to
Project → BuildPath → Config BuildPath
click Remove Jars from Modulepath
then click on classpath → Add external selenium jar files
Add all the required jar files inside classpath instead of module path. The same issue was also occurred with me but after adding the jars to classpath it got resolved.
I don't know anything about Selenium, but it looks like you have two modules that contain the exact same package name inside of them:
client.combined
net.bytebuddy
So when you say e.g. import org.openqa.selenium.WebDriver Eclipse doesn't know if you want to use that package from client.combined or from net.bytebuddy.
You need to either add a prefix in that import statement that will specify whether you're importing package org.openqa.selenium from client.combined or from net.bytebuddy.
You can possibly do this by just doing:
import client.combined.org.openqa.selenium.WebDriver
import client.combined.org.openqa.selenium.firefox.FirefoxDriver
or
import net.bytebuddy.org.openqa.selenium.WebDriver
import net.bytebuddy.org.openqa.selenium.firefox.FirefoxDriver
You can also try removing either of the packages (client.combined or net.bytebuddy) from your project
Add required JAR in class path instead of module path. Also delete unnecessary JARs which might have reference to the mentioned package.
I had the same error and removing the reference to one of the jar files solved the issue.
Remove the reference to one of the jar files that you added in java build path.
From the screen shot that you added I see you have reference to both
client-combined-3.6.0-sources.jar
and
client-combined-3.7.0.jar
both the packages have the same classes implemented.
Remove the reference to one and see if that help.
I had the same issue. I used JDK 9 and eclipse oxygen 64-bit version (Selenium 3.9.1). My first thought, it is the JDK 9, but I tested on IntelliJ IDEA JDK 9 and worked without any problem. So I installed the eclipse oxygen 32-bit version with JDK 8 (-no JDK 9 version on 32 bit) and the problem disappeared.
this happens when same java package code (package name + class name) is available in more than one jar file; for default modules every jar is exposed as Module. Modules essentially can not have same package name exported. This is more of a code cleanup task.

How to use sbt eclipse plugin to put all dependencies in eclipse Library Folder ClasspathContainer?

After I run activator eclipse command and import project into eclipse, we can see all dependencies be separated. I want to put all dependencies(jar) into a Library Folder ClasspathContainer when i run activator eclipse. So how to do it?
Just upgrade eclipse for the latest version.

Netbeans 8.0.1 package javax.microedition.lcdui.* does not exist

I get an error while using import javax.microedition.lcdui.*;
package javax.microedition.lcdui.* does not exist.
But the line import javax.microedition.midlet.MIDlet;
does not give any error.
Imoprt lcdui jar file in your application library. You can download this jar file from here. Download Jar file