org.apache canot be resolved in eclipse - java

import org.apache.poi.hssf.usermodel.*;
import org.w3c.dom.*;
import java.io.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
Please anyone tell me what does this error tells. and how to solve it.

I hope you would get the jar files from distribution files.
Here is the link Apache POI

Reason for the error is Your program cannot find org.apache.poi.hssf.usermodel.*; class so for this you to download jar containing org.apache.poi.hssf.usermodel.* and then set your classpath.
Here is the link to download jar

Related

package org.apache.hadoop does not exist

I'm trying to compile a java file which is importing hadoop packages.
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
But it fails with a message
error: package org.apache.hadoop.fs does not exist
I googled for this error and it seems that I have to edit $PATH
But I have no idea to what I have to fix the path.
How can I solve this import error?
You have bad import, its
import org.apache.hadoop.fs.Path;
Not
import org.apahce.hadoop.fs.Path;
The other posibility its you have bad import, can show how import the library of hadoop.

Google Cloud Messaging Smack Library

I am attempting to implement the Google Cloud Messaging CCS server written in Java, and I have downloaded the Smack library from here. My question is, which files do I place within my project in order to use these import statement?
import java.io.IOException;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.ConnectionConfiguration.SecurityMode;
import org.jivesoftware.smack.ConnectionListener;
import org.jivesoftware.smack.PacketInterceptor;
import org.jivesoftware.smack.PacketListener;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.filter.PacketTypeFilter;
import org.jivesoftware.smack.packet.DefaultPacketExtension;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smack.provider.PacketExtensionProvider;
import org.jivesoftware.smack.provider.ProviderManager;
import org.jivesoftware.smack.util.StringUtils;
import org.xmlpull.v1.XmlPullParser;
import org.jivesoftware.smack.SmackException;
You need to download the required libraries and import them into your project
I needed
Smack
JsonSimple
XmlPull 1.1.4.c
(Click for download links)
Once you've downloaded each library you need to import them into netbeans
Open your projects properties
Select Libraries
Select Add Library
Select Create
Add a name that indicates which library this is i.e Smack or JsonSimple so on
Add the jar, javadoc and sources if you downloaded them for each library
Rinse and repeat till all three libraries are added to your project

elasticsearch package import error

I am trying to import following packages in my .java file:-
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.client.Client;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.transport.InetSocketTransportAddress;
I am getting error that the above mentioned packages do not exist.
You need to download elastic search jar to make it work. Download it from here.
And add it to your classpath.

javax.net.ssl not found in Eclipse Helios Java EE

I'm using a project which has these imports in the beginning:
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLServerSocket;
import javax.net.ssl.SSLServerSocketFactory;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManagerFactory;
but Eclipse reports them as errors. How can I add these to my project?
Thanks.
Never mind. I found the .jar file. It is jsse.jar.

How to add 3rd party JAR's to compile time classpath in jGRASP?

What do I need to do to successfully the import ij package? I get an error:
ITCN_.java:1: package ij does not exist
The imports are:
import ij.*;
import ij.io.*;
import ij.gui.*;
import ij.process.*;
import ij.measure.*;
import ij.plugin.*;
import ij.plugin.frame.*;
import ij.plugin.filter.PlugInFilter;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import java.lang.*;
import java.text.*;
I also used Jgrasp back in the day.
I highly recommend moving to eclipse although jGrasp is very simple and works.
To Add to the Build Path you go to Settings -> PATH/CLASSPATH -> Workspace
Click on the "Path" tab, and then the "CLASSPATHS" subtab.
Then Click "New" and where it says Path or Jar file, enter in the path to the ij jar file. Do this for each file if there are more than one.
And then click "apply" and you should be able to use import ij.* and the subsequent functions
It's the ImageJ API. The API docs are available here. You can download it here. Once downloaded, just add the JAR(s) to the compiletime and runtime classpath.

Categories

Resources