kandi background
Explore Kits

zt-exec | ZeroTurnaround Process Executor

 by   zeroturnaround Java Version: Current License: Apache-2.0

 by   zeroturnaround Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | zt-exec Summary

zt-exec is a Java library. zt-exec has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub, Maven.
ZeroTurnaround Process Executor
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • zt-exec has a low active ecosystem.
  • It has 730 star(s) with 90 fork(s). There are 47 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 9 open issues and 59 have been closed. On average issues are closed in 355 days. There are 3 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of zt-exec is current.
zt-exec Support
Best in #Java
Average in #Java
zt-exec Support
Best in #Java
Average in #Java

quality kandi Quality

  • zt-exec has 0 bugs and 0 code smells.
zt-exec Quality
Best in #Java
Average in #Java
zt-exec Quality
Best in #Java
Average in #Java

securitySecurity

  • zt-exec has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • zt-exec code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
zt-exec Security
Best in #Java
Average in #Java
zt-exec Security
Best in #Java
Average in #Java

license License

  • zt-exec is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
zt-exec License
Best in #Java
Average in #Java
zt-exec License
Best in #Java
Average in #Java

buildReuse

  • zt-exec releases are not available. You will need to build from source code and install.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions are not available. Examples and code snippets are available.
  • zt-exec saves you 1530 person hours of effort in developing the same functionality from scratch.
  • It has 3411 lines of code, 426 functions and 80 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
zt-exec Reuse
Best in #Java
Average in #Java
zt-exec Reuse
Best in #Java
Average in #Java
Top functions reviewed by kandi - BETA

kandi has reviewed zt-exec and discovered the below as its top functions. This is intended to give you an instant insight into zt-exec implemented functionality, and help decide if they suit your requirements.

  • Start the downloader .
    • Wait for a process .
      • Close the streams .
        • Stops the piping thread .
          • Wait for the process .
            • Remove the shutdown hook .
              • Create a new ProcessInitException from an IOException .
                • Process the output .
                  • Main loop .
                    • Returns full class name .

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      zt-exec Key Features

                      Improved handling of streams

                      Reading/writing to streams

                      Redirecting stderr to stdout

                      Improved handling of timeouts

                      Improved checking of exit codes

                      Improved API

                      One liners for quite complex usecases

                      One liners to get process output into a String

                      Access to the Process object available

                      Support for async processes ( Future )

                      Improved logging with [SLF4J API](http://www.slf4j.org/)

                      Support for multiple processes

                      Output is pumped to NullOutputStream

                      Returning the exit code

                      Output is pumped to NullOutputStream

                      Return output as UTF8 String

                      Pumping the output to a logger

                      Pumping the output to a logger (short form for previous)

                      Pumping the output to the logger of the caller class

                      Pumping the output to a logger

                      Returning output as UTF8 String

                      Pumping the stderr to a logger

                      Returning the output as UTF8 String

                      Running with a timeout of 60 seconds

                      Output pumped to NullOutputStream

                      Pumping output to another OutputStream

                      Handling output line-by-line while process is running

                      Destroy the running process when VM exits

                      Output pumped to NullOutputStream

                      Run process with a specific environment variable

                      Output pumped to NullOutputStream

                      Run process with a specific environment

                      Output pumped to NullOutputStream

                      Throw exception when wrong exit code

                      Output is pumped to NullOutputStream

                      Throw exception when wrong exit code

                      Return output as UTF8 String

                      Starting process in the background

                      Output is pumped to NullOutputStream

                      Start process in the background

                      Return output as UTF8 String

                      default

                      copy iconCopydownload iconDownload
                      ...
                      <dependency>
                          <groupId>org.zeroturnaround</groupId>
                          <artifactId>zt-exec</artifactId>
                          <version>1.12</version>
                      </dependency>
                      ...

                      Unsupported JavaFX configuration: classes were loaded from 'unnamed module @...'

                      copy iconCopydownload iconDownload
                      public void start(Stage primaryStage) throws Exception {
                              System.setErr(oldErr); // reference to default System.err
                              ...
                      public static void main(String[] args) {
                              System.setErr(new PrintStream(new NullOutputStream())); 
                              launch();
                      }
                      

                      Community Discussions

                      Trending Discussions on zt-exec
                      • Unsupported JavaFX configuration: classes were loaded from 'unnamed module @...'
                      Trending Discussions on zt-exec

                      QUESTION

                      Unsupported JavaFX configuration: classes were loaded from 'unnamed module @...'

                      Asked 2021-Aug-04 at 18:12

                      This question seems very similar if not exactly the same. In that question, Slaw's 2nd suggestion involving fixing the module-info for correct module management seems appropriate. But what exactly does that mean; or rather, is there something wrong with my module that javafx is complaining about or is it some other module it's talking about?

                      This is my module-info.java

                      module myprogram.main {
                          requires javafx.controls;
                          requires javafx.fxml;
                          requires janino;
                          requires commons.compiler;
                          requires org.fxmisc.richtext;
                          requires wellbehavedfx;
                          requires zt.process.killer;
                          requires zt.exec;
                          exports com.bla.myprogram;
                          opens com.bla.myprogram to javafx.fxml;
                      }
                      

                      jdk: jdk16.0.1+9

                      java -jar .\MyProgram.jar

                      @Override
                          public void start(Stage primaryStage) throws Exception {
                              System.out.println("enter start");
                              ...
                      
                       public static void main(String[] args) {
                              System.out.println("enter main");
                              launch();
                          }
                      
                      enter main
                      Aug 04, 2021 1:22:52 PM com.sun.javafx.application.PlatformImpl startup
                      WARNING: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @6203f37a'
                      enter start
                      

                      (and this is my gradle.build if it has any significance)

                      plugins {
                          id 'java-library'
                          id 'application'
                          id 'org.openjfx.javafxplugin' version "0.0.10"
                      }
                      
                      group 'com.bla.myprogram'
                      version '0.3'
                      
                      def currentOS = org.gradle.internal.os.OperatingSystem.current()
                      def platform
                      if (currentOS.isWindows()) {
                          platform = 'win'
                      } else if (currentOS.isLinux()) {
                          platform = 'linux'
                      } else if (currentOS.isMacOsX()) {
                          platform = 'mac'
                      }
                      
                      repositories {
                          mavenCentral()
                      }
                      
                      dependencies {
                          testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.0'
                          testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
                          implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
                          implementation group: 'org.slf4j', name: 'slf4j-simple', version: '1.7.25'
                          implementation "org.openjfx:javafx-base:11:${platform}"
                          implementation "org.openjfx:javafx-graphics:11:${platform}"
                          implementation "org.openjfx:javafx-controls:11:${platform}"
                          implementation "org.openjfx:javafx-fxml:11:${platform}"
                          implementation group: 'org.codehaus.janino', name: 'janino', version: '3.0.7'
                          implementation group: 'org.fxmisc.richtext', name: 'richtextfx', version: '0.10.6'
                          implementation group: 'org.fxmisc.wellbehaved', name: 'wellbehavedfx', version: '0.3.3'
                          implementation group: 'org.zeroturnaround', name: 'zt-process-killer', version: '1.10'
                          implementation group: 'org.zeroturnaround', name: 'zt-exec', version: '1.12'
                      }
                      
                      test {
                          useJUnitPlatform()
                      }
                      
                      javafx {
                          version = "16"
                          modules = [ 'javafx.controls', 'javafx.fxml']
                      }
                      
                      mainClassName = 'com.bla.myprogram.Main'
                      
                      jar {
                          manifest {
                              attributes "Main-Class": 'com.bla.myprogram.Main'
                          }
                      
                          from { (configurations.runtimeClasspath).collect { it.isDirectory() ? it : zipTree(it) } } {
                              exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
                              duplicatesStrategy = DuplicatesStrategy.EXCLUDE
                          }
                      }
                      
                      task createProperties(dependsOn: processResources) {
                          doLast {
                              new File("$buildDir/resources/main/version.properties").withWriter { w ->
                                  Properties p = new Properties()
                                  p['version'] = project.version.toString()
                                  p['name'] = rootProject.name.toString()
                                  p.store w, null
                              }
                          }
                      }
                      
                      classes {
                          dependsOn createProperties
                      }
                      

                      ANSWER

                      Answered 2021-Aug-04 at 18:12

                      I think this might be the answer:

                      Shading multiple modules into the same jar is not possible, because a jar can only contain 1 module. So, I suppose the shade plugin resolves that problem by removing the module-info files of the dependencies it's using, which means the JavaFX code will not be loaded as a module, and you get a warning like this. I think the only way to get rid of the warning is to not use shading, but keep the JavaFX modules as separate jar files, that you then put on the module path when running the application.

                      So the obvious option is just to ignore the warning. Javafx warnings rarely seem to indicate anything useful. But it's not always an option to just look away if you distribute your application to other users.

                      Another (naive) option is to redirect the error stream at launch. It's a little naive because there might be some other error missed..

                      public void start(Stage primaryStage) throws Exception {
                              System.setErr(oldErr); // reference to default System.err
                              ...
                      public static void main(String[] args) {
                              System.setErr(new PrintStream(new NullOutputStream())); 
                              launch();
                      }
                      

                      Another option is to use something like jpackage instead of making a jar. Which might not be such a bad idea anyway, because the javafx libraries are different for each OS.

                      Source https://stackoverflow.com/questions/68650850

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install zt-exec

                      You can download it from GitHub, Maven.
                      You can use zt-exec like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the zt-exec component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                      Support

                      For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Share this Page

                      share link
                      Consider Popular Java Libraries
                      Try Top Libraries by zeroturnaround
                      Compare Java Libraries with Highest Support
                      Compare Java Libraries with Highest Quality
                      Compare Java Libraries with Highest Security
                      Compare Java Libraries with Permissive License
                      Compare Java Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.