How intellij idea sort imports by default? - java

I done some investigation, and got strange results.
My classes:
Test.java:
package com.company;
import com.company.data.Byte;
import com.company.data.Class;
import com.company.zata.Long;
import com.company.zata.Short;
import com.company.data.*;
import com.company.zata.*;
public class Test {
Object o1 = new Class();
Object o2 = new SomeClass();
Object o3 = new AppleClass();
Object o4 = new Byte();
Object o5 = new Long();
Object o6 = new Short();
Object o7 = new BetaClass();
}
All clases is simple, for test. For example one of all:
package com.company.data;
public class Class {
public Class() {
}
}
Tree of classes:
I try organize imports for Intellij IDEA, Eclipse and Netbeans and got results:
Intellij IDEA before organize imports:
import com.company.data.Byte;
import com.company.data.Class;
import com.company.zata.Long;
import com.company.zata.Short;
import com.company.data.*;
import com.company.zata.*;
Intellij IDEA after organize imports:
import com.company.data.Byte;
import com.company.data.Class;
import com.company.data.*;
import com.company.zata.*;
import com.company.zata.Long;
import com.company.zata.Short;
Eclipse before organize imports:
import com.company.data.Byte;
import com.company.data.Class;
import com.company.zata.Long;
import com.company.zata.Short;
import com.company.data.*;
import com.company.zata.*;
Eclipse after organize imports:
import com.company.data.*;
import com.company.data.Byte;
import com.company.data.Class;
import com.company.zata.*;
import com.company.zata.Long;
import com.company.zata.Short;
NetBeans before organize imports:
import com.company.data.Byte;
import com.company.data.Class;
import com.company.zata.Long;
import com.company.zata.Short;
import com.company.data.*;
import com.company.zata.*;
NetBeans after organize imports:
import com.company.data.Byte;
import com.company.data.Class;
import com.company.data.*;
import com.company.zata.*;
import com.company.zata.Long;
import com.company.zata.Short;
Eclipse sorting imports alphabetical.
How sorting imports Intellij IDEA and NetBeans - I do not understand.
I expected for Intellij IDEA and NetBeans this results:
import com.company.data.Byte;
import com.company.data.Class;
import com.company.data.*;
import com.company.zata.Long;
import com.company.zata.Short;
import com.company.zata.*;
Why Intellij Idea and Netbeans sort imports in this way?

The point is: why do you expect that different tools behave the very same way in the first place?!
You see, these different IDEs are using different rules that determine how imports are organized; and of course, those rules can be tweaked.
See this example how to make IntelliJ behave like eclipse; and over here for how to edit the Netbeans setup for this stuff.

This is only a wild guess of mine.
What I saw is that IntelliJ and Netbeans try to move the imports as little as possible. See how the two .* imports stick together? I think that is because before it organized the imports, they stuck together as well.
The two editors see that if they just move the last two lines up and make the third and fourth lines replace the position of the last two lines, the package names will be sort in alphabetical order! So that's what they did.
Unfortunately, I cannot test this myself. But if you change the initial position of the .* imports, the result of organizing the imports might change.
Try organizing this:
import com.company.data.Byte;
import com.company.data.Class;
import com.company.zata.Long;
import com.company.data.*;
import com.company.zata.Short;
import com.company.zata.*;
If my guess is correct, the editor will swap the third and fourth lines.

I got results with Intellij IDEA 15.0.1.
If we try to organize imports with latest version Intellij IDEA, we got result:
import com.company.data.Byte;
import com.company.data.Class;
import com.company.data.*;
import com.company.zata.Long;
import com.company.zata.Short;
import com.company.zata.*;
I think it is correct sorting.

Related

SQUARE cannot be resolved to a variable in Processing/Eclipse

I have a problem with the following code:
parent.strokeCap(SQUARE);
I tried importing these:
import processing.core.PApplet;
import processing.core.PGraphics;
import processing.core.PShape;
import processing.core.PConstants;
import processing.core.PShapeSVG;
import processing.core.PGraphicsJava2D;
import processing.core.PStyle;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
But the problem persists. Do I have to make another import? I tried to find what value SQUARE represents but was unable to find any info about what it should contain.
note that you're not writing "Processing", you're writing Java, with all the regular Java formalisms and requirements, with some of your imports simply being the Processing API library. If you need a library constant, PConstants.SQUARE will get you there.

Error initializing class com.jacob.com.Dispatch

I have jacob.jar in the WEB-INF\lib directory and jacob-1.16.1-x86.dll in the windows\system32 directory.
Works ok on a development box. On the production machine it falls over. I am Running Tomcat 7. Log contains:
java.lang.NoClassDefFoundError: Could not initialize class com.jacob.com.Dispatch
on this line:
Dispatch oCompy = new Dispatch("Compy.Connect")
Any suggestions?
EDIT:
As per the suggestion I have gone through the source of jacob but I cannot find any import statements that reference a library that would not normally be available. I will include the list here. I am relatively new to Java so maybe I am missing something:
jacob-1.16.1\src\com\jacob\activex\activexcomponent.java - import com.jacob.com.Dispatch;
jacob-1.16.1\src\com\jacob\activex\activexcomponent.java - import com.jacob.com.JacobObject;
jacob-1.16.1\src\com\jacob\activex\activexcomponent.java - import com.jacob.com.Variant;
jacob-1.16.1\src\com\jacob\activex\activexdispatchevents.java - import com.jacob.com.InvocationProxy;
jacob-1.16.1\src\com\jacob\activex\activexdispatchevents.java - import com.jacob.com.Dispatch;
jacob-1.16.1\src\com\jacob\activex\activexdispatchevents.java - import com.jacob.com.DispatchEvents;
jacob-1.16.1\src\com\jacob\activex\activexinvocationproxy.java - import com.jacob.com.Variant;
jacob-1.16.1\src\com\jacob\activex\activexinvocationproxy.java - import com.jacob.com.NotImplementedException;
jacob-1.16.1\src\com\jacob\activex\activexinvocationproxy.java - import java.lang.reflect.Method;
jacob-1.16.1\src\com\jacob\activex\activexinvocationproxy.java - import com.jacob.com.InvocationProxy;
jacob-1.16.1\src\com\jacob\activex\activexinvocationproxy.java - import java.lang.reflect.InvocationTargetException;
jacob-1.16.1\src\com\jacob\com\dateutilities.java - import java.util.Calendar;
jacob-1.16.1\src\com\jacob\com\dateutilities.java - import java.util.Date;
jacob-1.16.1\src\com\jacob\com\invocationproxyallvariants.java - import java.lang.reflect.InvocationTargetException;
jacob-1.16.1\src\com\jacob\com\invocationproxyallvariants.java - import java.lang.reflect.Method;
jacob-1.16.1\src\com\jacob\com\jacobreleaseinfo.java - import java.util.Properties;
jacob-1.16.1\src\com\jacob\com\jacobreleaseinfo.java - import java.io.InputStream;
jacob-1.16.1\src\com\jacob\com\jacobreleaseinfo.java - import java.io.IOException;
jacob-1.16.1\src\com\jacob\com\libraryloader.java - import java.util.Set;
jacob-1.16.1\src\com\jacob\com\libraryloader.java - import java.util.ResourceBundle;
jacob-1.16.1\src\com\jacob\com\libraryloader.java - import java.util.Locale;
jacob-1.16.1\src\com\jacob\com\libraryloader.java - import java.util.MissingResourceException;
jacob-1.16.1\src\com\jacob\com\libraryloader.java - import java.util.Enumeration;
jacob-1.16.1\src\com\jacob\com\libraryloader.java - import java.util.HashSet;
jacob-1.16.1\src\com\jacob\com\rot.java - import java.util.WeakHashMap;
jacob-1.16.1\src\com\jacob\com\rot.java - import java.util.Map;
jacob-1.16.1\src\com\jacob\com\rot.java - import java.util.Iterator;
jacob-1.16.1\src\com\jacob\com\rot.java - import java.util.HashMap;
jacob-1.16.1\src\com\jacob\com\variant.java - import java.util.Date;
jacob-1.16.1\src\com\jacob\com\variant.java - import java.math.BigInteger;
jacob-1.16.1\src\com\jacob\com\variant.java - import java.math.BigDecimal;
jacob-1.16.1\src\com\jacob\com\variantutilities.java - import java.util.Date;
jacob-1.16.1\src\com\jacob\com\variantutilities.java - import java.math.MathContext;
jacob-1.16.1\src\com\jacob\com\variantutilities.java - import java.math.BigDecimal;
jacob-1.16.1\src\com\jacob\com\variantutilities.java - import java.math.BigInteger;
jacob-1.16.1\src\com\jacob\com\variantutilities.java - import java.lang.reflect.Array;
EDIT:
I am not sure if this is actually an answer or not.
I fixed the problem by adding the websites WEB-INF\lib directory to the classpath for Tomcat. I feel that this is not the right answer because my understanding was that a website automatically includes the WEB-INF\lib into the classpath when the site is accessed.
What confuses the issue more is that the site has been running OK accessing other libs in that directory.
Having to add to the classpath is therefore a workaround for a misbehaving library. Which begs the question is a workaround the correct answer?? I guess I will leave the question open.
This error means that the class com.jacob.com.Dispatch is using another class and it can't find it.
If you have the class source code, check to see what classes it uses and see that you have them in your classpath.
If you don't, try to look at the documentation ,find the jar that contains the missing classes and add it to the classpath.

How do i get the java.net.URLConnection or the Hashtable from a class file?

How do i get the classes from the import list, or where do i find the imported class files. for example
import game.sprites.PlayerSprite;
import java.applet.Applet;
import java.awt.*;
import java.io.*;
import java.net.URL;
import java.util.Vector;
import litecom.Trace;
import litecom.gfxe.LoaderTarget2;
import litecom.gfxe.Timer;
import litecom.scoreclient2.ScoreClient2;
any idea how to get those java. files?
You don't. The import statements are not preserved in the bytecode. When you compile Java sources to class files (bytecode), the compiler inserts the fully qualified name of the classes which are referenced.

java, use dictionary for zip?

Hi I have source code from a program ,and when I test in NetBeans there is and error in import:
java.util.Dict;
Can anybody help me, please?
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry;
import java.io.FileOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.File;
import java.util.Dict;
There isn't a class called Dict. There is however a Dictionary class. Please check the API docs.

For Java, can I import all packages at once?

For example, the third party library uses very complex directory structure for the package.
Can I import them at once. the star seems can only imports one directory level.
Assuming you're asking whether or not you can do something like:
import com.example.*;
// expecting packages like com.example.foo.* and com.example.bar.* to be imported
Then the answer is no. The widest import you can make is a single package with a star.
The JLS (section 7.5) defines the structure for import statements.
Additionally, it would be problematic for the compiler to import a bunch of packages at once. If two packages provide the same type, both are imported, and the type is used in the class, a compile-time error occurs. This is described in JLS 6.5.5.1:
Otherwise, if a type of that name is
declared by more than one
type-import-on-demand declaration of
the compilation unit, then the name is
ambiguous as a type name; a
compile-time error occurs.
As you pointed in java you can only use "one level" import used by "*"
The more effective way is to open Eclipse, open class where imports should be and press: CTRL + SHIFT + O:) - nowadays all IDE helps with organize imports
I strongly suggest, as others have done, that you use the "organize imports" from your IDE (most major java IDE will do this).
Also, I advice against using "*" in your imports, and the reason for this is simple. At some time, you might want to upgrade one of the library that you import (or the jdk) and you might end up with name clashes due to some new classes in a package (this is especially true for the static imports). It might not be a big deal if that happens to a class inside your current project, but if you make that code into a library at some point, it might be more problematic as you will have to recompile that class after adjusting the conflicting imports.
(Yes, that happened to me not so long ago... It was a pain as I had to hunt down the library source code to rebuild.)
Save yourself some trouble down the road. :D
As others have already said, you can't import all packages at once. However, its not like the end of the world. If you use a good IDE like Intellij, it would add import statements with appropriate package name automatically to your code as soon as you write the code which is using a class/interface from that package.
There is another way if you want to import everything at once. This is not at all recommended but the trick is to go to https://docs.oracle.com/en/java/javase/16/docs/api/allpackages-index.html to check the list of all packages, save that html page on your local system, open the html code. remove all tags from head tag and add this code:
<style>
.block { display: none;}
</style>
After this, save the document and open it in a browser, you'll see the package names clearly without any description. Now, you can just copy-paste them and give them as input to a simple java program that converts them into proper import statements.
The final result is:
import com.sun.jarsigner.*;
import com.sun.java.accessibility.util.*;
import com.sun.jdi.*;
import com.sun.jdi.connect.*;
import com.sun.jdi.connect.spi.*;
import com.sun.jdi.event.*;
import com.sun.jdi.request.*;
import com.sun.management.*;
import com.sun.net.httpserver.*;
import com.sun.net.httpserver.spi.*;
import com.sun.nio.sctp.*;
import com.sun.security.auth.*;
import com.sun.security.auth.callback.*;
import com.sun.security.auth.login.*;
import com.sun.security.auth.module.*;
import com.sun.security.jgss.*;
import com.sun.source.doctree.*;
import com.sun.source.tree.*;
import com.sun.source.util.*;
import com.sun.tools.attach.*;
import com.sun.tools.attach.spi.*;
import com.sun.tools.javac.*;
import com.sun.tools.jconsole.*;
import java.applet.*;
import java.awt.*;
import java.awt.color.*;
import java.awt.datatransfer.*;
import java.awt.desktop.*;
import java.awt.dnd.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.im.*;
import java.awt.im.spi.*;
import java.awt.image.*;
import java.awt.image.renderable.*;
import java.awt.print.*;
import java.beans.*;
import java.beans.beancontext.*;
import java.io.*;
import java.lang.*;
import java.lang.annotation.*;
import java.lang.constant.*;
import java.lang.instrument.*;
import java.lang.invoke.*;
import java.lang.management.*;
import java.lang.module.*;
import java.lang.ref.*;
import java.lang.reflect.*;
import java.math.*;
import java.net.*;
import java.net.http.*;
import java.net.spi.*;
import java.nio.*;
import java.nio.channels.*;
import java.nio.channels.spi.*;
import java.nio.charset.*;
import java.nio.charset.spi.*;
import java.nio.file.*;
import java.nio.file.attribute.*;
import java.nio.file.spi.*;
import java.rmi.*;
import java.rmi.activation.*;
import java.rmi.dgc.*;
import java.rmi.registry.*;
import java.rmi.server.*;
import java.security.*;
import java.security.cert.*;
import java.security.interfaces.*;
import java.security.spec.*;
import java.sql.*;
import java.text.*;
import java.text.spi.*;
import java.time.*;
import java.time.chrono.*;
import java.time.format.*;
import java.time.temporal.*;
import java.time.zone.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import java.util.function.*;
import java.util.jar.*;
import java.util.logging.*;
import java.util.prefs.*;
import java.util.regex.*;
import java.util.spi.*;
import java.util.stream.*;
import java.util.zip.*;
import javax.accessibility.*;
import javax.annotation.processing.*;
import javax.crypto.*;
import javax.crypto.interfaces.*;
import javax.crypto.spec.*;
import javax.imageio.*;
import javax.imageio.event.*;
import javax.imageio.metadata.*;
import javax.imageio.plugins.bmp.*;
import javax.imageio.plugins.jpeg.*;
import javax.imageio.plugins.tiff.*;
import javax.imageio.spi.*;
import javax.imageio.stream.*;
import javax.lang.model.*;
import javax.lang.model.element.*;
import javax.lang.model.type.*;
import javax.lang.model.util.*;
import javax.management.*;
import javax.management.loading.*;
import javax.management.modelmbean.*;
import javax.management.monitor.*;
import javax.management.openmbean.*;
import javax.management.relation.*;
import javax.management.remote.*;
import javax.management.remote.rmi.*;
import javax.management.timer.*;
import javax.naming.*;
import javax.naming.directory.*;
import javax.naming.event.*;
import javax.naming.ldap.*;
import javax.naming.ldap.spi.*;
import javax.naming.spi.*;
import javax.net.*;
import javax.net.ssl.*;
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
import javax.print.event.*;
import javax.rmi.ssl.*;
import javax.script.*;
import javax.security.auth.*;
import javax.security.auth.callback.*;
import javax.security.auth.kerberos.*;
import javax.security.auth.login.*;
import javax.security.auth.spi.*;
import javax.security.auth.x500.*;
import javax.security.cert.*;
import javax.security.sasl.*;
import javax.sound.midi.*;
import javax.sound.midi.spi.*;
import javax.sound.sampled.*;
import javax.sound.sampled.spi.*;
import javax.sql.*;
import javax.sql.rowset.*;
import javax.sql.rowset.serial.*;
import javax.sql.rowset.spi.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.colorchooser.*;
import javax.swing.event.*;
import javax.swing.filechooser.*;
import javax.swing.plaf.*;
import javax.swing.plaf.basic.*;
import javax.swing.plaf.metal.*;
import javax.swing.plaf.multi.*;
import javax.swing.plaf.nimbus.*;
import javax.swing.plaf.synth.*;
import javax.swing.table.*;
import javax.swing.text.*;
import javax.swing.text.html.*;
import javax.swing.text.html.parser.*;
import javax.swing.text.rtf.*;
import javax.swing.tree.*;
import javax.swing.undo.*;
import javax.tools.*;
import javax.transaction.xa.*;
import javax.xml.*;
import javax.xml.catalog.*;
import javax.xml.crypto.*;
import javax.xml.crypto.dom.*;
import javax.xml.crypto.dsig.*;
import javax.xml.crypto.dsig.dom.*;
import javax.xml.crypto.dsig.keyinfo.*;
import javax.xml.crypto.dsig.spec.*;
import javax.xml.datatype.*;
import javax.xml.namespace.*;
import javax.xml.parsers.*;
import javax.xml.stream.*;
import javax.xml.stream.events.*;
import javax.xml.stream.util.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.sax.*;
import javax.xml.transform.stax.*;
import javax.xml.transform.stream.*;
import javax.xml.validation.*;
import javax.xml.xpath.*;
import jdk.dynalink.*;
import jdk.dynalink.beans.*;
import jdk.dynalink.linker.*;
import jdk.dynalink.linker.support.*;
import jdk.dynalink.support.*;
import jdk.javadoc.doclet.*;
import jdk.jfr.*;
import jdk.jfr.consumer.*;
import jdk.jshell.*;
import jdk.jshell.execution.*;
import jdk.jshell.spi.*;
import jdk.jshell.tool.*;
import jdk.management.jfr.*;
import jdk.net.*;
import jdk.nio.*;
import jdk.security.jarsigner.*;
import netscape.javascript.*;
import org.ietf.jgss.*;
import org.w3c.dom.*;
import org.w3c.dom.bootstrap.*;
import org.w3c.dom.css.*;
import org.w3c.dom.events.*;
import org.w3c.dom.html.*;
import org.w3c.dom.ls.*;
import org.w3c.dom.ranges.*;
import org.w3c.dom.stylesheets.*;
import org.w3c.dom.traversal.*;
import org.w3c.dom.views.*;
import org.w3c.dom.xpath.*;
import org.xml.sax.*;
import org.xml.sax.ext.*;
import org.xml.sax.helpers.*;
You can just copy-paste this to your .java files
Here's the java code that converts the name of packages to import statements:
import java.util.Scanner;
public class import_everything {
public static void main(String[] args) {
String[] s = new String[233];
int i = 0;
Scanner sc = new Scanner(System.in);
while (i < 223) {
s[i] = sc.next();
s[i] = "import " + s[i] + ".*;";
i++;
}
i = 0;
while (i < 223) {
System.out.println(s[i]);
i++;
}
}
}
And here's the list of all the java packages obtained by changing html code of the official documentation provided at https://docs.oracle.com/en/java/javase/16/docs/api/allpackages-index.html :
com.sun.jarsigner
com.sun.java.accessibility.util
com.sun.jdi
com.sun.jdi.connect
com.sun.jdi.connect.spi
com.sun.jdi.event
com.sun.jdi.request
com.sun.management
com.sun.net.httpserver
com.sun.net.httpserver.spi
com.sun.nio.sctp
com.sun.security.auth
com.sun.security.auth.callback
com.sun.security.auth.login
com.sun.security.auth.module
com.sun.security.jgss
com.sun.source.doctree
com.sun.source.tree
com.sun.source.util
com.sun.tools.attach
com.sun.tools.attach.spi
com.sun.tools.javac
com.sun.tools.jconsole
java.applet
java.awt
java.awt.color
java.awt.datatransfer
java.awt.desktop
java.awt.dnd
java.awt.event
java.awt.font
java.awt.geom
java.awt.im
java.awt.im.spi
java.awt.image
java.awt.image.renderable
java.awt.print
java.beans
java.beans.beancontext
java.io
java.lang
java.lang.annotation
java.lang.constant
java.lang.instrument
java.lang.invoke
java.lang.management
java.lang.module
java.lang.ref
java.lang.reflect
java.math
java.net
java.net.http
java.net.spi
java.nio
java.nio.channels
java.nio.channels.spi
java.nio.charset
java.nio.charset.spi
java.nio.file
java.nio.file.attribute
java.nio.file.spi
java.rmi
java.rmi.activation
java.rmi.dgc
java.rmi.registry
java.rmi.server
java.security
java.security.acl
java.security.cert
java.security.interfaces
java.security.spec
java.sql
java.text
java.text.spi
java.time
java.time.chrono
java.time.format
java.time.temporal
java.time.zone
java.util
java.util.concurrent
java.util.concurrent.atomic
java.util.concurrent.locks
java.util.function
java.util.jar
java.util.logging
java.util.prefs
java.util.regex
java.util.spi
java.util.stream
java.util.zip
javax.accessibility
javax.annotation.processing
javax.crypto
javax.crypto.interfaces
javax.crypto.spec
javax.imageio
javax.imageio.event
javax.imageio.metadata
javax.imageio.plugins.bmp
javax.imageio.plugins.jpeg
javax.imageio.plugins.tiff
javax.imageio.spi
javax.imageio.stream
javax.lang.model
javax.lang.model.element
javax.lang.model.type
javax.lang.model.util
javax.management
javax.management.loading
javax.management.modelmbean
javax.management.monitor
javax.management.openmbean
javax.management.relation
javax.management.remote
javax.management.remote.rmi
javax.management.timer
javax.naming
javax.naming.directory
javax.naming.event
javax.naming.ldap
javax.naming.ldap.spi
javax.naming.spi
javax.net
javax.net.ssl
javax.print
javax.print.attribute
javax.print.attribute.standard
javax.print.event
javax.rmi.ssl
javax.script
javax.security.auth
javax.security.auth.callback
javax.security.auth.kerberos
javax.security.auth.login
javax.security.auth.spi
javax.security.auth.x500
javax.security.cert
javax.security.sasl
javax.smartcardio
javax.sound.midi
javax.sound.midi.spi
javax.sound.sampled
javax.sound.sampled.spi
javax.sql
javax.sql.rowset
javax.sql.rowset.serial
javax.sql.rowset.spi
javax.swing
javax.swing.border
javax.swing.colorchooser
javax.swing.event
javax.swing.filechooser
javax.swing.plaf
javax.swing.plaf.basic
javax.swing.plaf.metal
javax.swing.plaf.multi
javax.swing.plaf.nimbus
javax.swing.plaf.synth
javax.swing.table
javax.swing.text
javax.swing.text.html
javax.swing.text.html.parser
javax.swing.text.rtf
javax.swing.tree
javax.swing.undo
javax.tools
javax.transaction.xa
javax.xml
javax.xml.catalog
javax.xml.crypto
javax.xml.crypto.dom
javax.xml.crypto.dsig
javax.xml.crypto.dsig.dom
javax.xml.crypto.dsig.keyinfo
javax.xml.crypto.dsig.spec
javax.xml.datatype
javax.xml.namespace
javax.xml.parsers
javax.xml.stream
javax.xml.stream.events
javax.xml.stream.util
javax.xml.transform
javax.xml.transform.dom
javax.xml.transform.sax
javax.xml.transform.stax
javax.xml.transform.stream
javax.xml.validation
javax.xml.xpath
jdk.dynalink
jdk.dynalink.beans
jdk.dynalink.linker
jdk.dynalink.linker.support
jdk.dynalink.support
jdk.javadoc.doclet
jdk.jfr
jdk.jfr.consumer
jdk.jshell
jdk.jshell.execution
jdk.jshell.spi
jdk.jshell.tool
jdk.management.jfr
jdk.nashorn.api.scripting
jdk.nashorn.api.tree
jdk.net
jdk.nio
jdk.security.jarsigner
netscape.javascript
org.ietf.jgss
org.w3c.dom
org.w3c.dom.bootstrap
org.w3c.dom.css
org.w3c.dom.events
org.w3c.dom.html
org.w3c.dom.ls
org.w3c.dom.ranges
org.w3c.dom.stylesheets
org.w3c.dom.traversal
org.w3c.dom.views
org.w3c.dom.xpath
org.xml.sax
org.xml.sax.ext
org.xml.sax.helpers
just use somthing like
Import java.*
As In the case of JSPs,can I use a .inc file to import all the required classes from 3rd party libraries in a java class
You can import only one directory level.
In IntelliJ Ctrl + Alt + O shortcut can be helpful to:
organize existing imports
remove unneeded imports
add required imports
You can also adjust the auto-import settings under "Settings → Editor → General → Auto Import"
For Basic Usage Only You can use:
import java.*;
import javax.*;
* is for all
java.*;
all classes in java package.

Categories