Java JAR will not execute on VSCode Codespace

55 Views Asked by At

After building my project's JAR with jar cvfm Project.jar MANIFEST.MF -C bin/com/dacoder/project/ ., my JAR would not execute, outputting no main manifest attribute, in Project.jar. I am working on a Codespace (no build tools, but a VSCode extension will build and execute the classes automatically)

Linking a manifest with my projects entry point does not seem to work, as it doesnt seem to detect a manifest even though jar tf Project.jar outputs all of my projects classes along with the manifest. (The manifest includes Main-Class: com.dacoder.project.Project)

For some reason, attempting to execute just the entry point class file (java Project.class) does not work (throws ClassNotFoundException unless I specify the classpath with java -cp bin com.dacoder.project.Project), however trying something similar with the JAR (java -cp Project.jar com.dacoder.project.Project) also outputs ClassNotFoundException, regardless of the specified classpath.

I made a post on another forum that did not get any answers if that answers any other questions.

I appreciate any help, thank you!

0

There are 0 best solutions below