This site requires JavaScript, please enable it in your browser!
Greenfoot back
JohnDoeWasTaken
JohnDoeWasTaken wrote ...

2019/4/13

Exported project doesn't launch

JohnDoeWasTaken JohnDoeWasTaken

2019/4/13

#
Hello, I'm having issues with exporting my project into a standalone .jar file. While the project runs fine within the Greenfoot IDE, exported version does not run and I'm having trouble debugging it. I have tried:
  • putting try/catch around my code in world's constructor
  • commenting out pieces of code that, ehm, "give Greenfoot the bad touch" (AKA go through Greenfoot's internal classes and their fields using reflection)
  • enabling Java console in hopes of getting to the startup error
None of these gave me any useful clues. Could anyone help me out and look at the scenario's source code? Important parts for fixing the issue are probably GameManager, UIManager, WindowManager, CursorManager and GreenfootRipper. Link to the scenario
danpost danpost

2019/4/13

#
I did not find a sounds folder with the scenario folder. (?) Maybe that could be the problem.
JohnDoeWasTaken JohnDoeWasTaken

2019/4/13

#
danpost wrote...
I did not find a sounds folder with the scenario folder. (?) Maybe that could be the problem.
The scenario doesn't use any sounds yet and the exported .jar has worked previously even in a location with no "sounds" folder present. However, on my drive, there is such a folder, although empty, so that probably isn't the issue anyway. Folder screenshot My guess would be that it just wasn't uploaded because it was empty.
JohnDoeWasTaken JohnDoeWasTaken

2019/4/13

#
I have also tried unzipping the .jar file as a basic check of whether the exported files are corrupted, but everything seemed fine. I also reinstalled JRE, but to no avail
JohnDoeWasTaken JohnDoeWasTaken

2019/4/14

#
Alright, I have found the problem. When I export the .jar file into the same directory where the greenfoot project is, no .class files for my own classes are added into the .jar archive. When I set the destination folder for export literally wherever other than the project folder, .class files are added correctly and the game runs as expected. This seems to me like a bug in Greenfoot. Can I report it anywhere on this site, other than writing an email to the support?
You need to login to post a reply.