Giter Club home page Giter Club logo

java9demo's Introduction

Java9Demo

Java 9 new features

The Project is split into several maven modules.

  1. Intro : basic Java 9 module demo.
  2. Address: small module required by Person
  3. Person: small module showing module dependency between each other
  4. Relect: example of open module
  5. Reflect: module using deep reflection to open module
  6. Prime: service module
  7. PrimeFast: provider of prime
  8. PrimeGeneric: provider of prime
  9. PrimeProbable: provider of prime
  10. PrimeClient: client of Prime Service
  11. Version: showing correct and incorrect version strings for JDK 9
  12. Resources: resources to be accessed from ResourceAccess module
  13. ResourceAccess: shows access to resources from another module
  14. ModuleApi: shows usage of modular API.
  15. ModuleAnnotation: annotated module example
  16. LayerInfo: module which has class printing layer info. Used in ModuleApi
  17. JshellDemo: module showing usage of Jshell API
  18. ProcessDemo: Process API examples
  19. CollectionsDemo: Updates to Java Collections
  20. HttpDemo: HTTP/2 demo usage
  21. StackWalking: new stackwalker api usage
  22. StreamDemo: Reactive streams and updates to streaming api

ModuleApi includes:

  • FindModule: find module by path
  • LayerTest: show layer information for required module
  • LoadClass: load class from required module
  • Module: print module for module and required ones
  • QueryModule: check if module open and exported
  • ReadModuleContents: show resources of specified module

ProcessDemo includes:

  • CurrentProcessInfo: show info about current process
  • Job: a job which sleeps at a regular interval up to a max duration.Interval and duration can be set as parameters on start
  • StartProcess: run a new process (uses Job class)
  • ProcessStats: obtain a process handle and show some stats
  • ManagingProcessPermission: working with permissions

CollectionsDemo includes:

  • ListDemo: new way of creating unmodifiable lists
  • SetDemo: new way of creating unmodifiable sets
  • MapDemo: new way of creating unmodifiable maps

StackWalking includes:

  • StackWalker: shows stack walking though the stack of function calls
  • GetCallerCallerClass: get the name of a class which calls a method
  • PermissionCheck: instantiate stackwalker before and after installing a SecurityManager

StreamDemo includes:

  • NumberPrinter: simple pub-sub usage.
  • PeriodicPublisher: pulisher which publishes items periodically to custom subscribers instantiated to items
  • ProcessorDemo: fitler processor usage
  • StreamDemo: new streaming API features
  • CollectorsDemo: new collectors features

Build and run Java 9 module:

      mvn clean install 
      
      java --module-path <path-to-target>/<maven-module-name>.jar -m <jigsaw-module-name>/<package-name>.<main-class>
      
      or if there are many modules
      
       java --module-path <path-to-target>/<maven-module-name>.jar:<path-to-target>/<maven-module-name>.jar
        -m <jigsaw-module-name>/<package-name>.<main-class>

As far as I understand one maven module can have only one java module

Classic biuld and run:

   mvn clean install
   
   java -jar <path-to-target>/<jar-name>.jar

Before build change main class name in pom for the demo you want to run

java9demo's People

Contributors

abondar24 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.