0

So I have a program which allows you to edit a couple settings through a "settings.json" file as seen here: https://prnt.sc/jzx8p8

My problem is that this file seems to not compile along with my program, as seen here: https://prnt.sc/jzx8t2 (If you're wondering I have that error message pop up myself: https://prnt.sc/jzx8y2)

I am using IntelliJ's artifact support to compile my program. Help is appreciated, thanks!

Edit: The program runs 100% as it should when I run it through IntelliJ but not when I try to run it through my VPS.

Julio Galan
  • 134
  • 2
  • 10

2 Answers2

0

Your json file is not in the classpath and thus is not visible. Move it into resources folder and that should work

Michael Gantman
  • 7,315
  • 2
  • 19
  • 36
  • When moving the file to the resources folder the program doesn't run correctly anymore http://prntscr.com/jzxej4 and when it is where it previously was it does run correctly (only though running with IntelliJ) – Julio Galan Jun 27 '18 at 11:25
0

You are loading it from the working directory as a file, not as a resource from the classpath. Either specify/calculate the full file path so that it works on any system or change your code to load the resource from the classpath and move the file into resources directory.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904