Java class getResource() with eclipse

后端 未结 2 1800
悲&欢浪女
悲&欢浪女 2021-01-05 23:30

i\'ve been trying to get getResource to work correctly this whole morning but so far the only way i\'ve had to get it working is by moving the res folder to the bin folder a

2条回答
  •  伪装坚强ぢ
    2021-01-05 23:59

    Nevermind, i can't believe how stupid of a fix that was.

    I added the res folder to the main project folder rather than bin, then went in eclipse

    run > run configurations > classpath > select user entries > advanced > add folders > select res

    then when calling a folder from res, rather than doing "/res/gfx/entity/entity1.png", i did "/gfx/entity/entity1.png"

    Problem solved!

提交回复
热议问题