Skip to content

michaelknigge/janel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

license Build status Download original version Download enhanced version

Java Native Executable / Launcher

Janel is a free, Open Source Java native executable and launcher for Windows. Launch your Java application just like other Windows executables. Within the configuration file set the location of the JVM, any of the Java system properties such as classpath, and more. A choice of non-console and console applications is available. The process name is whatever you choose for your .exe file. New for Janel 4.x is the ability to use the Janel executable as a Windows service.

GitHub vs. Sourceforge

This project is a spin-off of the great Janel by Timothy Kil. Since version 3.4.0 of Janel I'm contributing code that enhances Janel and I always have passed my enhancements to Timothy. Some of my enhancements and fixes of version 4.0.4 sadly got lost on the way to the official version.

Note that the original Janel by Timothy Kil is no longer under active development. So I decided to create this GitHub project that makes it a lot easier for me to bring my enhancements and fixes to the public and keep Janel alive.

Every release of my enhanced Janel is built by the free Continuous Delivery service AppVeyor in a clean environment. The status badges at the top of the page will guide you to the download pages.

Note that my enhancements and fixes will be available in the branch enhanced. The master branch contains an unmodified version of the Janel source code available at Sourceforge

How to build

See the manual How to build.

How to run

See the manual How to run.

Enhancements

These are my enhancements to the official Version of Janel 4.2.0

Support of Java 9 and newer

Java 9 is fully supported (JDK and JRE). With version 9 the Windows registry keys that hold version information about installed Java versions changed. Furthermore, the JDK does no longer contain a subdirectory "jre" that contains the JRE. Due to these changes Janel had to be enhanced.

Fix crash at startup if an environment variable is missing

Version 4.2.0 of Janel will crash at startup if you reference an environment variable in the LAP file that is not set. Imagine you want to add specific JARs to the CLASSPATH at runtime and specify

janel.classpath.jars.dir.recursive=${env.USER_DEFINED_JARS_FOLDER}

in the LAP file. Now if the environment variable USER_DEFINED_JARS_FOLDER is not set, Janel will crash. My enhanced version fixes this bug.

Support of OpenJDK (HotSpot and OpenJ9)

Janel will consider JVMs from Oracle and the JVMs releasd by AdoptOpenJDK.

Fix crash at startup if the bitness of the JVM and Janel does not match

If you set the path of the JVM to be used, i. e. with

janel.java.home.path=C:\Program Files\Java\jdk1.8.0_101

then Janel crashes if the bitness of the JVM does not match the bitness of the Janel executable. My enhanced version shows an error message that describes the problem to the user:

Error in Java launcher. The DLL "C:\Program Files\Java\jdk1.8.0_101\jre\bin\server\jvm.dll"
could not be loaded. The bitness of the DLL and the running
process "JanelConsole32.exe" are different

Specify the behaviour of bitness mismatch

Now you can specify how Janel should behave if the bitness of the JVM and the Janel executable does not match. Per default (see above) Janel will exit with an error message. But now you can also instruct Janel that it shall continue to look for a JVM that can be used. An example:

janel.jvm.bitness.mismatch=skip
janel.java.home.path=${env.JAVA_HOME}

Now Janel will try to use the JVM located in the directory specified in the environment variable JAVA_HOME - but if the bitness mismatches, Janel will continue to look for another suitable JVM.

Specify JVM options on the command line

Janel uses the LAP file to pass options to the JVM. But for command line applications it is often desireable to specify (or override) JVM options at the command line. With the new Janel property

janel.allow.jvm.options=true

exactly this is possible. If set to true, Janel will treat each command line parameter that starts with a single "-" as a Java option and pass this to the JVM. Note that these options are passed after the options specified in the LAP file. So for example if you specify the option -Xmx4G in the LAP file and -Xmx12G at the command line, the last one (12G) will win.

Fix crash due to runtime modifications by anti-virus software

Certain anti virus programs add themselves as agent via Java's intrumentation API. In such a case the original release of Janel will crash.

Support of Azul Zulu JDK

Janel will consider Azul Zulu JDKs.

Additional property value variables

The new variable SELF_NAME contains the path and name of the Janel executable with a trailing ".exe" removed. This variable is useful for the new custom property janel.environment.file.

Additional environment variables can be set before entering the JVM

In some circumstances it might be useful to let Janel set some additional environment variables before entering the JVM. Using a new custom property you can provide a file (in properties format) that contains environment variables to be set. The new variable SELF_NAME is useful for this.

janel.environment.file=${SELF_NAME}.env

Using this configuration, you can place a file with the suffix ".env" right beside your .exe that contains key-value-pairs of environment variabes to be set.

Nesting of .LAP files

It might be useful to set defaults in the LAP file of your application, but let the user change those defaults without having the user to change the LAP file everytime a new release of the software is released.

janel.include.file=${SELF_NAME}.inc

Using this configuration, you can place a file with the suffix ".inc" right beside your .exe that may contain any entry that might occur in a LAP file. You should place this at the end (or at least nearly at th end) of your LAP file so the properties of your "include file" will be read at the and therefore override the properties of the LAP file.

Fix codepage problems when passing options and/or properties to the JVM

If an entry in the LAP file contains some special characters (i. e. german umlauts) they have not been passed correctly to the JVM.

Converted documentation from HTML to Markdown

The documentation is now available in Markdown. See the manuals How to build and How to run.

Manifest for 4K display support

The Janel executable now contains a manifast that causes enables correct 4K support for GUI applications. The manifest contains the following settings:

<windowsSettings>
  <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
  <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</windowsSettings>

Manifest for better security

The Janel executable now contains a manifast that sets the execution level. The manifest contains the following setting:

<security>
  <requestedPrivileges>
    <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
  </requestedPrivileges>
</security>

The values of requestedExecutionLevel and uiAccess are well documented in MSDN.

License

MIT License

Copyright (c) 2017-2025 Timothy Kil, Michael Knigge and others who had contributed code to Janel

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Janel is a free, Open Source Java native executable and launcher for Windows

Resources

License

Stars

Watchers

Forks

Packages

No packages published