0

I am trying to deploy a JAR into Docker.

The problem I am running into is building the JAR. (with IntelliJ)

I clicked File -> Project Structure then went to 'Artifacts' and clicked the 'Create Archive' button.

I provided a name for the JAR ("SimpleService.jar")

I clicked CREATE MANIFEST and then the following have been done

  1. Manifest File location is selected
  2. Main class is set to com.oneorangetree.Main
  3. Class Path is "C:\Program Files\Java\jdk-17.0.1\lib*.jar"

This is the first time I am trying to deploy a Java application. I am not sure what #2 and #3 should be set to.

Source Code

Manifest

software is fun
  • 7,286
  • 18
  • 71
  • 129
  • 1
    Main class is the class that contains the `public static void main(String[] args)` method that should be executed (you can have multiple classes in a Jar that have a main method). – Robert Jan 06 '22 at 15:54
  • so am i supposed to put the File Path in the "Main Class" or the class name like "Main.class" – software is fun Jan 06 '22 at 16:50
  • See https://stackoverflow.com/a/42200519/104891 for the sample working project. – CrazyCoder Jan 06 '22 at 17:11
  • The demo worked but is there any 'tutorial' that tells you how to do this to your own project? – software is fun Jan 06 '22 at 19:58
  • 1
    You don't need to specify any class path in the manifest. The one you specify explicitly overrides the default classpath and the class is not found. – CrazyCoder Jan 06 '22 at 20:00

0 Answers0