Java SE & Spring Packages, Java Coding Without IDE

Oracle Java Logo Transparent

For me the difficult aspect of coding in Java without IDE is to know the package location of some class we are going to use. Even  something like spring annotations we use it regularly in web development, it is hard to find the locations.

1. Just using asterisk

The hardest part of doing Java programming is to remember the package location, because there's gonna be so many classes you're gonna use along the way your programming. You only need to remember the package location.

A. Java SE Packages

Here's some most used Java standard package location:

java.beans
Contains classes related to developing beans -- components based on the JavaBeans™ architecture.

java.beans.beancontext
Provides classes and interfaces relating to bean context.

java.io
Provides for system input and output through data streams, serialization and the file system.

java.lang
Provides classes that are fundamental to the design of the Java programming language.

java.lang.annotation
Provides library support for the Java programming language annotation facility.

java.lang.instrument
Provides services that allow Java programming language agents to instrument programs running on the JVM.

java.lang.invoke
The java.lang.invoke package contains dynamic language support provided directly by the Java core class libraries and virtual machine.

java.lang.management
Provides the management interfaces for monitoring and management of the Java virtual machine and other components in the Java runtime.

java.lang.ref
Provides reference-object classes, which support a limited degree of interaction with the garbage collector.

java.lang.reflect
Provides classes and interfaces for obtaining reflective information about classes and objects.

java.math
Provides classes for performing arbitrary-precision integer arithmetic (BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal).

java.net
Provides the classes for implementing networking applications.

java.nio
Defines buffers, which are containers for data, and provides an overview of the other NIO packages.

java.nio.channels
Defines channels, which represent connections to entities that are capable of performing I/O operations, such as files and sockets; defines selectors, for multiplexed, non-blocking I/O operations.

java.nio.channels.spi
Service-provider classes for the java.nio.channels package.

java.nio.charset
Defines charsets, decoders, and encoders, for translating between bytes and Unicode characters.

java.nio.charset.spi
Service-provider classes for the java.nio.charset package.

java.nio.file
Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.

java.nio.file.attribute
Interfaces and classes providing access to file and file system attributes.

java.nio.file.spi
Service-provider classes for the java.nio.file package.

java.security
Provides the classes and interfaces for the security framework.

java.security.acl
The classes and interfaces in this package have been superseded by classes in the java.security package.

java.security.cert
Provides classes and interfaces for parsing and managing certificates, certificate revocation lists (CRLs), and certification paths.

java.security.interfaces
Provides interfaces for generating RSA (Rivest, Shamir and Adleman AsymmetricCipher algorithm) keys as defined in the RSA Laboratory Technical Note PKCS#1, and DSA (Digital Signature Algorithm) keys as defined in NIST's FIPS-186.

java.security.spec
Provides classes and interfaces for key specifications and algorithm parameter specifications.

java.text
Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages.

java.text.spi
Service provider classes for the classes in the java.text package.

java.time
The main API for dates, times, instants, and durations.

java.time.chrono
Generic API for calendar systems other than the default ISO.

java.time.format
Provides classes to print and parse dates and times.

java.time.temporal
Access to date and time using fields and units, and date time adjusters.

java.time.zone
Support for time-zones and their rules.

java.util
Contains the collections framework, legacy collection classes, event model, date and time facilities, internationalization, and miscellaneous utility classes (a string tokenizer, a random-number generator, and a bit array).

java.util.concurrent
Utility classes commonly useful in concurrent programming.

java.util.concurrent.atomic
A small toolkit of classes that support lock-free thread-safe programming on single variables.

java.util.concurrent.locks
Interfaces and classes providing a framework for locking and waiting for conditions that is distinct from built-in synchronization and monitors.

java.util.function
Functional interfaces provide target types for lambda expressions and method references.

java.util.jar
Provides classes for reading and writing the JAR (Java ARchive) file format, which is based on the standard ZIP file format with an optional manifest file.

java.util.logging
Provides the classes and interfaces of the JavaTM 2 platform's core logging facilities.

java.util.prefs
This package allows applications to store and retrieve user and system preference and configuration data.

java.util.regex
Classes for matching character sequences against patterns specified by regular expressions.

java.util.spi
Service provider classes for the classes in the java.util package.

java.util.stream
Classes to support functional-style operations on streams of elements, such as map-reduce transformations on collections.

java.util.zip
Provides classes for reading and writing the standard ZIP and GZIP file formats.

javax.annotation
javax.annotation.processing
Facilities for declaring annotation processors and for allowing annotation processors to communicate with an annotation processing tool environment.

javax.crypto
Provides the classes and interfaces for cryptographic operations.

javax.crypto.interfaces
Provides interfaces for Diffie-Hellman keys as defined in RSA Laboratories' PKCS #3.

javax.crypto.spec
Provides classes and interfaces for key specifications and algorithm parameter specifications.

javax.imageio
The main package of the Java Image I/O API.

javax.imageio.event
A package of the Java Image I/O API dealing with synchronous notification of events during the reading and writing of images.

javax.imageio.metadata
A package of the Java Image I/O API dealing with reading and writing metadata.

javax.imageio.plugins.bmp
Package containing the public classes used by the built-in BMP plug-in.

javax.imageio.plugins.jpeg
Classes supporting the built-in JPEG plug-in.

javax.imageio.spi
A package of the Java Image I/O API containing the plug-in interfaces for readers, writers, transcoders, and streams, and a runtime registry.

javax.imageio.stream
A package of the Java Image I/O API dealing with low-level I/O from files and streams.

javax.lang.model
Classes and hierarchies of packages used to model the Java programming language.

javax.lang.model.element
Interfaces used to model elements of the Java programming language.

javax.lang.model.type
Interfaces used to model Java programming language types.

javax.lang.model.util
Utilities to assist in the processing of program elements and types.

javax.management
Provides the core classes for the Java Management Extensions.

javax.management.loading
Provides the classes which implement advanced dynamic loading.

javax.management.modelmbean
Provides the definition of the ModelMBean classes.

javax.management.monitor
Provides the definition of the monitor classes.

javax.management.openmbean
Provides the open data types and Open MBean descriptor classes.

javax.management.relation
Provides the definition of the Relation Service.

javax.management.remote
Interfaces for remote access to JMX MBean servers.

javax.management.remote.rmi
The RMI connector is a connector for the JMX Remote API that uses RMI to transmit client requests to a remote MBean server.

javax.management.timer
Provides the definition of the Timer MBean.

javax.naming
Provides the classes and interfaces for accessing naming services.

javax.naming.directory
Extends the javax.naming package to provide functionality for accessing directory services.

javax.naming.event
Provides support for event notification when accessing naming and directory services.

javax.naming.ldap
Provides support for LDAPv3 extended operations and controls.

javax.naming.spi
javax.net
Provides classes for networking applications.

javax.net.ssl
Provides classes for the secure socket package.

javax.print
Provides the principal classes and interfaces for the JavaTM Print Service API.

javax.print.attribute
Provides classes and interfaces that describe the types of JavaTM Print Service attributes and how they can be collected into attribute sets.

javax.print.attribute.standard
Package javax.print.attribute.standard contains classes for specific printing attributes.

javax.print.event
Package javax.print.event contains event classes and listener interfaces.

javax.script
The scripting API consists of interfaces and classes that define Java TM Scripting Engines and provides a framework for their use in Java applications.

javax.security.auth
This package provides a framework for authentication and authorization.

javax.security.auth.callback
This package provides the classes necessary for services to interact with applications in order to retrieve information (authentication data including usernames or passwords, for example) or to display information (error and warning messages, for example).

javax.security.auth.kerberos
This package contains utility classes related to the Kerberos network authentication protocol.

javax.security.auth.login
This package provides a pluggable authentication framework.

javax.security.auth.spi
This package provides the interface to be used for implementing pluggable authentication modules.

javax.security.auth.x500
This package contains the classes that should be used to store X500 Principal and X500 Private Credentials in a Subject.

javax.security.cert
Provides classes for public key certificates.

javax.security.sasl
Contains class and interfaces for supporting SASL.

javax.sound.midi
Provides interfaces and classes for I/O, sequencing, and synthesis of MIDI (Musical Instrument Digital Interface) data.

javax.sound.midi.spi
Supplies interfaces for service providers to implement when offering new MIDI devices, MIDI file readers and writers, or sound bank readers.

javax.sound.sampled
Provides interfaces and classes for capture, processing, and playback of sampled audio data.

javax.sound.sampled.spi
Supplies abstract classes for service providers to subclass when offering new audio devices, sound file readers and writers, or audio format converters.

javax.tools
Provides interfaces for tools which can be invoked from a program, for example, compilers.

B. Spring Framework Pacakages 

Spring is I believe to be the most popular framework for Java development, so here's also list of packages most used in spring framework:

org.springframework.aop
Core Spring AOP interfaces, built on AOP Alliance AOP interoperability interfaces.

org.springframework.aop.aspectj
AspectJ integration package.

org.springframework.aop.aspectj.annotation
Classes enabling AspectJ 5 @Annotated classes to be used in Spring AOP.

org.springframework.aop.aspectj.autoproxy
Base classes enabling auto-proxying based on AspectJ.

org.springframework.aop.config
Support package for declarative AOP configuration, with XML schema being the primary configuration format.

org.springframework.aop.framework
Package containing Spring's basic AOP infrastructure, compliant with the AOP Alliance interfaces.

org.springframework.aop.framework.autoproxy
Bean post-processors for use in ApplicationContexts to simplify AOP usage by automatically creating AOP proxies without the need to use a ProxyFactoryBean.

org.springframework.aop.interceptor
Provides miscellaneous interceptor implementations.

org.springframework.aop.support
Convenience classes for using Spring's AOP API.

org.springframework.beans
This package contains interfaces and classes for manipulating Java beans.

org.springframework.beans.factory
The core package implementing Spring's lightweight Inversion of Control (IoC) container.

org.springframework.beans.factory.annotation
Support package for annotation-driven bean configuration.

org.springframework.beans.factory.config
SPI interfaces and configuration-related convenience classes for bean factories.

org.springframework.beans.factory.parsing
Support infrastructure for bean definition parsing.

org.springframework.beans.factory.support
Classes supporting the org.springframework.beans.factory package.

org.springframework.beans.factory.xml
Contains an abstract XML-based BeanFactory implementation, including a standard "spring-beans" XSD.

org.springframework.cache.interceptor
AOP-based solution for declarative caching demarcation.

org.springframework.cache.jcache.interceptor
AOP-based solution for declarative caching demarcation using JSR-107 annotations.

org.springframework.context
This package builds on the beans package to add support for message sources and for the Observer design pattern, and the ability for application objects to obtain resources using a consistent API.

org.springframework.context.annotation
Annotation support for the Application Context, including JSR-250 "common" annotations, component-scanning, and Java-based metadata for creating Spring-managed objects.

org.springframework.context.event
Support classes for application events, like standard context events.

org.springframework.context.expression
Expression parsing support within a Spring application context.

org.springframework.context.support
Classes supporting the org.springframework.context package, such as abstract base classes for ApplicationContext implementations and a MessageSource implementation.

org.springframework.context.weaving
Load-time weaving support for a Spring application context, building on Spring's LoadTimeWeaver abstraction.

org.springframework.core
Provides basic classes for exception handling and version detection, and other core helpers that are not specific to any part of the framework.

org.springframework.core.annotation
Core support package for annotations, meta-annotations, and merged annotations with attribute overrides.

org.springframework.core.codec
Encoder and Decoder abstractions to convert between a reactive stream of bytes and Java objects.

org.springframework.core.convert
Type conversion system API.

org.springframework.core.serializer.support
Support classes for Spring's serializer abstraction.

org.springframework.dao
Exception hierarchy enabling sophisticated error handling independent of the data access approach in use.

org.springframework.dao.annotation
Annotation support for DAOs.

org.springframework.ejb.access
This package contains classes that allow easy access to EJBs.

org.springframework.http.client
Contains an abstraction over client-side HTTP.

org.springframework.http.codec
Provides implementations of Encoder and Decoder for web use.

org.springframework.http.codec.cbor
org.springframework.http.codec.json
JSON encoder and decoder support.

org.springframework.http.codec.multipart
Multipart support.

org.springframework.http.codec.protobuf
Provides an encoder and a decoder for Google Protocol Buffers.

org.springframework.http.codec.xml
XML encoder and decoder support.

org.springframework.http.converter
Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.

org.springframework.instrument.classloading
Support package for load time weaving based on class loaders, as required by JPA providers (but not JPA-specific).

org.springframework.jca.cci
This package contains Spring's support for the Common Client Interface (CCI), as defined by the J2EE Connector Architecture.

org.springframework.jca.context
Integration package that allows for deploying a Spring application context as a JCA 1.7 compliant RAR file.

org.springframework.jdbc
The classes in this package make JDBC easier to use and reduce the likelihood of common errors.

org.springframework.jdbc.datasource.init
Provides extensible support for initializing databases through scripts.

org.springframework.jdbc.datasource.lookup
Provides a strategy for looking up JDBC DataSources by name.

org.springframework.jdbc.support
Support classes for the JDBC framework, used by the classes in the jdbc.core and jdbc.object packages.

org.springframework.jdbc.support.xml
Abstraction for handling fields of SQLXML data type.

org.springframework.jms
This package contains integration classes for JMS, allowing for Spring-style JMS access.

org.springframework.jms.annotation
Annotations and support classes for declarative JMS listener endpoints.

org.springframework.jms.connection
Provides a PlatformTransactionManager implementation for a single JMS ConnectionFactory, and a SingleConnectionFactory adapter.

org.springframework.jms.listener.adapter
Message listener adapter mechanism that delegates to target listener methods, converting messages to appropriate message content types (such as String or byte array) that get passed into listener methods.

org.springframework.jms.support.converter
Provides a MessageConverter abstraction to convert between Java objects and JMS messages.

org.springframework.jms.support.destination
Support classes for Spring's JMS framework.

org.springframework.jmx
This package contains Spring's JMX support, which includes registration of Spring-managed beans as JMX MBeans as well as access to remote JMX MBeans.

org.springframework.jmx.access
Provides support for accessing remote MBean resources.

org.springframework.jmx.export
This package provides declarative creation and registration of Spring-managed beans as JMX MBeans.

org.springframework.jmx.export.assembler
Provides a strategy for MBeanInfo assembly.

org.springframework.jmx.export.metadata
Provides generic JMX metadata classes and basic support for reading JMX metadata in a provider-agnostic manner.

org.springframework.jmx.export.notification
Provides supporting infrastructure to allow Spring-created MBeans to send JMX notifications.

org.springframework.jndi
The classes in this package make JNDI easier to use, facilitating the accessing of configuration stored in JNDI, and provide useful superclasses for JNDI access classes.

org.springframework.jndi.support
Support classes for JNDI usage, including a JNDI-based BeanFactory implementation.

org.springframework.mail
Spring's generic mail infrastructure.

org.springframework.messaging
Support for working with messaging APIs and protocols.

org.springframework.messaging.handler
Basic abstractions for working with message handler methods.

org.springframework.messaging.handler.annotation.reactive
Support classes for working with annotated message-handling methods with non-blocking, reactive contracts.

org.springframework.messaging.handler.annotation.support
Support classes for working with annotated message-handling methods.

org.springframework.messaging.handler.invocation
Common infrastructure for invoking message handler methods.

org.springframework.messaging.handler.invocation.reactive
Common infrastructure for invoking message handler methods with non-blocking, and reactive contracts.

org.springframework.messaging.rsocket
Support for the RSocket protocol.

org.springframework.messaging.rsocket.annotation.support
Support classes for working with annotated RSocket stream handling methods.

org.springframework.messaging.simp.annotation.support
Support classes for handling messages from simple messaging protocols (like STOMP).

org.springframework.messaging.simp.stomp
Generic support for simple messaging protocols (like STOMP).

org.springframework.messaging.simp.user
Support for handling messages to "user" destinations (i.e.

org.springframework.mock.web.reactive.function.server
Mock objects for the functional web framework.

org.springframework.orm
Root package for Spring's O/R Mapping integration classes.

org.springframework.orm.hibernate5
Package providing integration of Hibernate 5.x with Spring concepts.

org.springframework.orm.jpa
Package providing integration of JPA (Java Persistence API) with Spring concepts.

org.springframework.orm.jpa.support
Classes supporting the org.springframework.orm.jpa package.

org.springframework.oxm
Root package for Spring's O/X Mapping integration classes.

org.springframework.remoting
Exception hierarchy for Spring's remoting infrastructure, independent of any specific remote method invocation system.

org.springframework.remoting.jaxws
Remoting classes for Web Services via JAX-WS (the successor of JAX-RPC), as included in Java 6 and Java EE 5.

org.springframework.remoting.rmi
Remoting classes for conventional RMI and transparent remoting via RMI invokers.

org.springframework.remoting.soap
SOAP-specific exceptions and support classes for Spring's remoting subsystem.

org.springframework.scheduling
General exceptions for Spring's scheduling support, independent of any specific scheduling system.

org.springframework.scheduling.annotation
Java 5 annotation for asynchronous method execution.

org.springframework.scheduling.quartz
Support classes for the open source scheduler Quartz, allowing to set up Quartz Schedulers, JobDetails and Triggers as beans in a Spring context.

org.springframework.scripting
Core interfaces for Spring's scripting support.

org.springframework.scripting.bsh
Package providing integration of BeanShell (and BeanShell2) into Spring's scripting infrastructure.

org.springframework.scripting.support
Support classes for Spring's scripting package.

org.springframework.test.context
This package contains the Spring TestContext Framework which provides annotation-driven unit and integration testing support that is agnostic of the actual testing framework in use.

org.springframework.test.context.event
Test event support classes for the Spring TestContext Framework.

org.springframework.test.context.jdbc
JDBC support classes for the Spring TestContext Framework, including support for declarative SQL script execution via @Sql.

org.springframework.test.context.support
Support classes for the Spring TestContext Framework.

org.springframework.test.context.transaction
Transactional support classes for the Spring TestContext Framework.

org.springframework.test.context.web
Web support classes for the Spring TestContext Framework.

org.springframework.test.web.reactive.server
Support for testing Spring WebFlux server endpoints via WebTestClient.

org.springframework.transaction
Spring's core transaction management APIs (independent of any specific transaction management system); an exception hierarchy for Spring's transaction infrastructure; and transaction manager, definition, and status interfaces.

org.springframework.transaction.event
Spring's support for listening to transaction events.

org.springframework.transaction.interceptor
AOP-based solution for declarative transaction demarcation.

org.springframework.transaction.support
Support classes for the org.springframework.transaction package.

org.springframework.validation
Provides data binding and validation functionality, for usage in business and/or UI layers.

org.springframework.validation.beanvalidation
Support classes for integrating a JSR-303 Bean Validation provider (such as Hibernate Validator) into a Spring ApplicationContext and in particular with Spring's data binding and validation APIs.

org.springframework.web.bind
Provides web-specific data binding functionality.

org.springframework.web.bind.support
Support classes for web data binding.

org.springframework.web.client
Core package of the client-side web support.

org.springframework.web.context.support
Classes supporting the org.springframework.web.context package, such as WebApplicationContext implementations and various utility classes.

org.springframework.web.method
Common infrastructure for handler method processing, as used by Spring MVC's org.springframework.web.servlet.mvc.method package.

org.springframework.web.method.annotation
Support classes for annotation-based handler method processing.

org.springframework.web.method.support
Generic support classes for handler method processing.

org.springframework.web.multipart
Multipart resolution framework for handling file uploads.

org.springframework.web.multipart.support
Support classes for the multipart resolution framework.

org.springframework.web.reactive
Top-level package for the spring-webflux module that contains DispatcherHandler, the main entry point for WebFlux server endpoint processing including key contracts used to map requests to handlers, invoke them, and process the result.

org.springframework.web.reactive.config
Spring WebFlux configuration infrastructure.

org.springframework.web.reactive.function
Provides a foundation for both the reactive client and server subpackages.

org.springframework.web.reactive.function.client
Provides a reactive WebClient that builds on top of the org.springframework.http.client.reactive reactive HTTP adapter layer.

org.springframework.web.reactive.function.client.support
Classes supporting the org.springframework.web.reactive.function.client package.

org.springframework.web.reactive.function.server
Provides the types that make up Spring's functional web framework for Reactive environments.

org.springframework.web.reactive.function.server.support
Classes supporting the org.springframework.web.reactive.function.server package.

org.springframework.web.reactive.handler
Provides HandlerMapping implementations including abstract base classes.

org.springframework.web.reactive.result
Support for various programming model styles including the invocation of different types of handlers, e.g.

org.springframework.web.reactive.result.method
Infrastructure for handler method processing.

org.springframework.web.reactive.result.method.annotation
Infrastructure for annotation-based handler method processing.

org.springframework.web.reactive.result.view
Support for result handling through view resolution.

org.springframework.web.reactive.result.view.freemarker
Support classes for the integration of FreeMarker as Spring web view technology.

org.springframework.web.reactive.result.view.script
Support classes for views based on the JSR-223 script engine abstraction (as included in Java 6+), e.g.

org.springframework.web.server
Core interfaces and classes for Spring's generic, reactive web support.

org.springframework.web.servlet.function.support
Classes supporting the org.springframework.web.servlet.function package.

org.springframework.web.servlet.handler
Provides standard HandlerMapping implementations, including abstract base classes for custom implementations.

org.springframework.web.servlet.mvc.annotation
Support package for annotation-based Servlet MVC controllers.

org.springframework.web.servlet.mvc.method
Servlet-based infrastructure for handler method processing, building on the org.springframework.web.method package.

org.springframework.web.servlet.mvc.method.annotation
MVC infrastructure for annotation-based handler method processing, building on the org.springframework.web.method.annotation package.

org.springframework.web.servlet.mvc.support
Support package for MVC controllers.

org.springframework.web.servlet.view
Provides standard View and ViewResolver implementations, including abstract base classes for custom implementations.

org.springframework.web.servlet.view.groovy
Support classes for the integration of Groovy Templates as Spring web view technology.

org.springframework.web.servlet.view.tiles3
Support classes for the integration of Tiles 3 (the standalone version of Tiles) as Spring web view technology.

org.springframework.web.servlet.view.xslt
Support classes for XSLT, providing a View implementation for XSLT stylesheets.

org.springframework.web.socket.messaging
WebSocket integration for Spring's messaging module.

org.springframework.web.socket.server
Server-side abstractions for WebSocket interactions.

org.springframework.web.socket.server.support
Server-side support classes including container-specific strategies for upgrading a request.

org.springframework.web.socket.sockjs
Top-level SockJS types.

You just need to do import the package name above with asterisk, and all the class will be available. But again the major reason way Java using namespaces is that to make the codes more readable, so by using asterisks the code will be bit more unreadable.

2. Allocate time to remember

Java is mature language, if you decide to make Java as your first language, in my opinion it is really good investment to remember the syntax and many of Java SE and frameworks classes, you can build anything in Java. Java is not just language for developing Web or Desktop applications, you can use Java to build anything, Machine Learning, Artificial intelligent, internet of things. Anything can be done with Java, it is really recommended language for building any kind of application.

If you get stuck using some Java libraries, because some classes feel it's to complicated to use, you can do Google search, there will be plenty of explanations on Google. Java is really popular, you can read documentations, use cases, anywhere on the internet.

I think you should write Java codes using the IDE, use the best Java IDE as possible, the one i really love is IntelliJ from JetBrains. Although it is not free, and quite expensive for personal use, still it's worth to try. You can use the community version if you want to, but with less framework support, but it's already smart enough to do Java programming.

Popular posts from this blog

ERROR 1348 Column Password Is Not Updatable When Updating MySQL Root Password

How To Create Spring Boot Project Using Netbeans

Spring Kafka - How to use ReplyingKafkaTemplate send and reply synchronously