• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

jlink: command not found

by admin

A new tool, called jlink was introduced in Java 9 that enables the creation of modular runtime images. These runtime images are nothing but a collection of a set of modules and their dependencies. A Java enhancement proposal, JEP 220, governs the structure of this runtime image.

The JLink tool is designed to provide optional phases between compile time and runtime, called link time, which links a set of modules and its transitive dependencies to create runtime images. JLink makes deployment simpler and also reduces the size of an application.

The invocation syntax of jLink is as follows:

jlink --module-path [modulepath] --add-modules [modules] --limit-modules [modules] --output [path]

Here,
–module-path – jLink use module path for finding modules such as modular jars, JMOD files
–add-modules – Mention module which needs to include in default set of modules for run time image, by default set of modules in empty.
–limit-modules – Use this option to limits modules, which is required for our application.
–output – Final resulting run-time image will be stored in output directory
–help – list details about jLink options
–version – show the version number

If you get the below error while running the jlink command:

jlink: command not found

you may install the below package as per your choice of distribution.

Distribution Command
Debian apt-get install openjdk-12-jdk-headless
Ubuntu apt-get install openjdk-9-jdk-headless
Arch Linux pacman -S jdk10-openjdk
Kali Linux apt-get install openjdk-11-jdk-headless
Fedora dnf install java-9-openjdk-devel-debug-1
Raspbian apt-get install openjdk-9-jdk-headless

Conclusion

A new tool in JDK 9 is the jlink command—Java’s linker for creating custom runtime images. You can include just what’s necessary for a given app or set of apps to execute in a custom runtime. For example, if you’re creating a runtime for a device that does not support GUIs, you can create a runtime without the corresponding modules that support Swing and JavaFX.

Filed Under: Java, Linux

Some more articles you might also be interested in …

  1. How to recreate LVM device files under /dev directory using vgmknodes
  2. How to configure iSCSI Initiator (client) in CentOS / RHEL 7
  3. numlockx: command not found
  4. archlinux-java: command not found
  5. grub2-install: command not found
  6. rtorrent: command not found
  7. ifrename Command Examples in Linux
  8. restorecon Command Examples in Linux
  9. How to enable CUPS Debugging on CentOS/RHEL
  10. lastcomm: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright