Samasaur1 / CityManagement

A text-based city management game
3 stars 7 forks source link

Doesn't Open! #37

Closed drewarteaga closed 5 years ago

drewarteaga commented 5 years ago

Describe the bug:

When I tried to run the file, it didn't work because there was a NoClassDefFoundError

To Reproduce:

  1. Download CItyManagement v0.8.1
  2. Run java -jar CityManagement-0.8.1.jar

Expected behavior:

The game should have started

Screenshots:

screen shot 2018-09-14 at 5 01 11 pm

Desktop (please complete the following information):

Stack trace:

Exception in thread "main" java.lang.NoClassDefFoundError: com/gauck/sam/Utilities/Utilities
    at com.samgauck.CityManagement.Economy.<init>(Economy.java:14)
    at com.samgauck.CityManagement.Economy.getInstance(Economy.java:29)
    at com.samgauck.CityManagement.Command.<init>(Command.java:23)
    at com.samgauck.CityManagement.Command.getInstance(Command.java:46)
    at com.samgauck.CityManagement.Main.<clinit>(Main.java:44)
Caused by: java.lang.ClassNotFoundException: com.gauck.sam.Utilities.Utilities
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 5 more

Additional context:

It happened as soon as I tried to start it.

Samasaur1 commented 5 years ago

Working on it

Samasaur1 commented 5 years ago

This bug exists since 0.8.0, which is the first version when Utilities was external

Samasaur1 commented 5 years ago

Utilities is not included in the JAR file, and so is not included in the class path.

Running:

java -cp path/to/CityManagement-0.8.1.jar:path/to/Utilities-1.4.0.jar com.samgauck.CityManagement.Main

will work

Samasaur1 commented 5 years ago

If the application plugin is applied, then gradle assembleDist is run, a zip file and a tar.gz file are created CityManagement-0.8.1.zip