Why I cannot use Arrays class in my Java project? - java

I am trying to compile this program in my IntelliJ IDE, but my IDE returns that it cannot resolve Arrays symbol.
Click to enlarge
Note that as you see in the left sidebar,I already added all the required libraries to my project!
This is imports of my program :
import java.io.*;
import java.util.*;
import java.security.*;
import java.security.Security;
import java.security.cert.*;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.bouncycastle.cms.*;
import java.util.Arrays;
As you see I added import java.util.Arrays to the program imports also, but nothing changed and I still have the above problem with Arrays.
Note that I tried to run the program on another computer, with the same version of IntelliJ IDE, but JDK 1.7 installed, and I have this problem there, but In my current computer (That JDK 1.8 is installed), the above problem appears.
Update:
In the line import java.util.Arrays, Arrays is red and that means there is no Arrays class in util. Why I should have this error, while I install JDK 1.8 and added all of its libraries to my project?

Related

getting a import cannot be resolved error for import org.apache.http.client.methods.HttpGet

Im using eclipse Photon. The code worcked fine on old computer. When I got a new computer and tried to run the program The following imports are give me a import cannot be resolved error
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
I'm assuming im missing some jar files. Could some one tell me what jar files I need and whare i can find them? Also why does it work find on ole computer with same jars being added?
Those two classes are part of Apache HTTP Components which you can access from https://hc.apache.org/index.html.

I Added a jar into my Eclipse project, but still it doesn't import

package esta.fontend;
import java.awt.*;
import java.sql.*;
import javax.swing.*;
import esta.dbConnection.ConnectionDB;
import net.proteanit.sql.DbUtils;// This is where i find the problem;
Image Link explaining my problem
rs2xml.jar doesn't contain the needed java class.
The most probably reason is that it was built incorrectly.
As you may see it contains 'src.net.proteanit.sql' which is empty.
So to fix the problem the jar should be rebuilt
The package should not include 'src' prefix
The DbUtils class should be truly included into it.

Cannot find java.nio.file.Files

i need to import java.nio.file.* but cannot find the jar containing this package
I installed new version of jdk 1.8 but still i cannot import this package .Can anybody tell me the jar file containing this package.
Thanks
I think the package want you to import is java input output.
Used this
import java.io.file.*;
Instead of
import java.nio.file.*;

Importing javax package in Java without an IDE

I'm developing a project in Java using Vim, and I need to use some classes from the javax package. What should I install and configure to be able to import any of them?
I already installed the JDK 7 and also put it as my default using update-alternative command.
For example, when I compile a class (for example one called GUI) that uses the javax package, the compiler displays:
> javac GUI.java
GUI.java:1: error: package javax does not exists
import javax.swing;
^
1 error
I think it is related to the $CLASSPATH environment variable, but I'm not sure how to tell the compiler where the package is (since it is inside the JDK 7).
Instead of trying to import javax.swing, which does not actually specify anything specific, you should import javax.swing.*. This imports everything in the javax.swing package.
import javax.swing.*;
You can also import specific swing components and utilities:
import javax.swing.JButton;
See The Java Tutorials page on Using Package Members for more information about importing package members.
You should be importing as:
import javax.swing.*;
or else for example
import javax.swing.JFrame;

Java Class PPM, PPMImage not found, where to get JAR Files

I need help and wanted to ask if somebody knows where to get the JAR Files for my system library (eclipse helios), cause I need to use those classes PPM and PPMImage but the import declarations seem not to work
package com.sun.media.imageio.plugins.pnm;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.io.*;
import java.lang.*;
import com.apple.*;
import de.medieninf.ads.*;
this is what I have implemented so far
I googled this hard but couldnt find anything.
You need to install Java Advanced Image and its plugin Java Advanced Image I/O Tools: JAI 1.1.3 and JAI I/O Tools 1.1
These provide you the PNM plugins are trying to use.

Categories