Can't import Eclipse Datatools - java

I am just trying to import the datatools of eclipse after I installed the necessary plugins for the DTP (DTP, GEF and EMF + XSD).
Eclipse keeps on telling me, that the import cannot be found.
Actually, I am not even able to import ANYTHING from org.eclipse.*
Help appreciated!!
import org.eclipse.datatools.modelbase.sql.query.ValueExpressionColumn;
import org.eclipse.datatools.modelbase.sql.query.helper.StatementHelper;
import org.eclipse.datatools.sqltools.parsers.sql.SQLParseErrorInfo;
import org.eclipse.datatools.sqltools.parsers.sql.SQLParserException;

Related

Java android how import into project import com.zebra.sdk.comm.Connection;

I don not have idea how I can import this :
import com.zebra.sdk.comm.Connection;
import com.zebra.sdk.comm.ConnectionException;
import com.zebra.sdk.printer.discovery.DiscoveredPrinter;
import com.zebra.sdk.printer.discovery.DiscoveredPrinterUsb;
import com.zebra.sdk.printer.discovery.DiscoveryHandler;
import com.zebra.sdk.printer.discovery.UsbDiscoverer;
I compile compileSdkVersion 'Zebra Technologies Corp:EMDK APIs:26'
And I can not import this
I had the same problem and i solved it.
Check this link and click Add ZSDK_ANDROID_API.jar to my Eclipse/Android Studio Project. Follow the steps.
it works for me.
You just need to get ZSDK_ANDROID_API.jar and you can find it here
I hope it helps you.

How to upgrade javax.naming.* and javax.xml.* imports to be compatible with java 10

I have a java project built with maven and jdk 1.8. Some classes use javax.naming.* and javax.xml.* classes in the jdk.
From Java 9 onwards those javax packages have been removed from the jdk. So how do I upgrade the project to run on java 9 or later?
Here are the classes,
import javax.naming.Binding;
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.NameClassPair;
import javax.naming.NameParser;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.NoInitialContextException;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
import javax.naming.directory.ModificationItem;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.event.EventContext;
import javax.naming.event.EventDirContext;
import javax.naming.event.NamingListener;
import javax.naming.ldap.Control;
import javax.naming.ldap.ExtendedRequest;
import javax.naming.ldap.ExtendedResponse;
import javax.naming.ldap.LdapContext;
import javax.naming.spi.InitialContextFactory;
import javax.naming.spi.InitialContextFactoryBuilder;
import javax.naming.spi.NamingManager;
import javax.xml.namespace.QName;
I have found out jndi contains javax.naming.* classes. But I am not sure how to include them. Just adding as a maven dependency does not work.
These classes have not been removed, see the JavaDoc for javax.naming and javax.xml.namespace. Unless you are building a module and forgot to add the modules java.xml and java.naming as dependencies, the mistake lies outside of Java, most likely with the tooling.
To convince yourself, compile a simple class on the command line with javac and watch it work. Then make sure you are running recent versions of the involved tools (particularly build tool and IDE). If that's the case and the error persists, improve your question with a more detailed description of the error.

Unable to compatible Organize imports between eclipse and intellij Idea for inner classes

As below, eclipse and intellij idea working differently for inner class DBInputSplit
Eclipse:
import org.apache.hadoop.mapreduce.lib.db.DBConfiguration;
import org.apache.hadoop.mapreduce.lib.db.DBInputFormat.DBInputSplit;
import org.apache.hadoop.mapreduce.lib.db.DBRecordReader;
import org.apache.hadoop.mapreduce.lib.db.DBWritable;
Intelliji Idea:
import org.apache.hadoop.mapreduce.lib.db.DBConfiguration;
import org.apache.hadoop.mapreduce.lib.db.DBRecordReader;
import org.apache.hadoop.mapreduce.lib.db.DBWritable;
import org.apache.hadoop.mapreduce.lib.db.DBInputFormat.DBInputSplit;
Here the order for DBInputSplit import differs.
Any suggestion? Can we make intelliji orderding as same as Eclipse ordering.
For eclipse, we are using natural ordering (i.e. com, java, javax, org)
You can setup import ordering in IDEA: Settings-> Editor-> Code Style-> Java-> Look at bottom section "Import Layout".

Google Analytics API 4 Java client running from command com.google.analyticsreporting.v4 package does not exist

I'm running the API 3 with Java from Windows command using javac and java to compile, no problem. I'm trying the API 4 but can't make even the basic example to run. I understand my problem must be in the classpath but can't pinpoint on the problem. Can't see the com.google packages
I downloaded the API 4 Java Client, copied all .jar in libs to a folder libs in my project. Also copied google-api-services-analyticsreporting-v4-rev110-1.22.0.jar to the libs
I'm testing the service account example as in
https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/service-java
I setup the compiler as (I know the path exists)
javac -classpath ".;C:\Java\GAnalytics\libs\*" HelloAnalytics4.java
I also tried adding the subdirectories in the client
Error Package does not exit:
import com.google.api.client.googleapis.auth.oauth2.GoogleCredential;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.gson.GsonFactory;
import com.google.analyticsreporting.v4.AnalyticsreportingScopes;
import com.google.analyticsreporting.v4.Analyticsreporting;
import com.google.analyticsreporting.v4.model.ColumnHeader;
import com.google.analyticsreporting.v4.model.DateRange;
import com.google.analyticsreporting.v4.model.DateRangeValues;
import com.google.analyticsreporting.v4.model.Dimension;
import com.google.analyticsreporting.v4.model.GetReportsRequest;
import com.google.analyticsreporting.v4.model.GetReportsResponse;
import com.google.analyticsreporting.v4.model.Metric;
import com.google.analyticsreporting.v4.model.MetricHeaderEntry;
import com.google.analyticsreporting.v4.model.Report;
import com.google.analyticsreporting.v4.model.ReportRequest;
import com.google.analyticsreporting.v4.model.ReportRow;
What am I missing?
Same problem for me, I solved by substituting all
"com.google.analyticsreporting.v4" ---> "com.google.api.services.analyticsreporting.v4"
and also:
Analyticsreporting --> AnalyticsReporting
Here the screen of the google-api-services-analyticsreporting-v4-rev111-1.22.0.jar unzipped

Old netbeans web app with woodstock

I am having pretty much this same issue:
JavaEE/NetBeans Library Referencing
I have done what is suggested by downloading Netbeans 6.7 and Glassfish 2, but I still don't have the libraries needed.
Here's what one of my files looks like:
import com.sun.data.provider.RowKey;
import com.sun.data.provider.impl.CachedRowSetDataProvider;
import com.sun.rave.web.ui.appbase.AbstractPageBean;
import com.sun.sql.rowset.CachedRowSetXImpl;
import com.sun.webui.jsf.component.Body;
import com.sun.webui.jsf.component.Button;
import com.sun.webui.jsf.component.DropDown;
import com.sun.webui.jsf.component.Form;
import com.sun.webui.jsf.component.Head;
import com.sun.webui.jsf.component.Html;
import com.sun.webui.jsf.component.Label;
import com.sun.webui.jsf.component.Link;
import com.sun.webui.jsf.component.MessageGroup;
import com.sun.webui.jsf.component.Page;
import com.sun.webui.jsf.component.StaticText;
import com.sun.webui.jsf.component.TextField;
import com.sun.webui.jsf.model.SingleSelectOptionsList;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.faces.FacesException;
import javax.faces.component.UISelectItems;
import javax.faces.component.html.HtmlSelectOneMenu;
import javax.faces.event.ValueChangeEvent;
import javax.sql.rowset.CachedRowSet;
I do not have any of the com.sun... packages and can't seem to find them anywhere.
I don't have very much experience with web apps/netbeans so any help would be appreciated. I realize that this is very outdated and should probably be migrated to something else, but for now I'd like to just make a few small edits and would rather not rewrite everything.
Thanks!
I originally had opened the project in a newer version of Netbeans that didn't have Wodostock/JSF. For some reason, it wouldn't work when opening with the older version of Netbeans. However, after deleting it and opening it again with the old version first, it worked.

Categories

Resources