Problem with the creation of a .jar with libraries connected



  • Good day! The problem was that JRE could not find the necessary library, although it was listed in the manifest.

    Here's the manifest:

    Manifest-Version: 1.0
    Class-Path: jintellitype-1.3.7.jar
    Main-Class: yanislavPackage.CloudBufferClient   
    

    Structure .jar file:

    .jre

    And it's a mistake to start from the console:

    cmd

    (Of course, the error is related to the problem of finding the library: HotKeyListener (see error) comes first in imports, and if it is changed, any other imports of classes from this library will be made mistakes.)

    Maybe someone had a problem like this and could help me.



  • quoting https://docs.oracle.com/javase/tutorial/deployment/jar/downman.html

    Attention.: Title Class-Path in the manifest indicates classes or JAR files on the local network, not classes and JAR files inside your JAR file or available online. To download classes from JAR file inside your JAR file, you need to get your class loader. For example, if the file MyJar.jar inside MyUtils.jar♪ you can't use the title ♪ Class-Path in file manifest MyJar.jarthat to load the classes from MyUtils.jar

    Well, they don't.

    • Or take it out. jintellitype-1.3.7.jar From your JAR file and put it next door.

    • Either do what they call Uber JAR. jintellitype-1.3.7.jar with your JAR. Here, as mentioned by @Etki, you'll need to maven-shade-pluginif you use maven.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2