Export from Eclipse causes trouble

I’m using LWJGL to make a game.
Now I have a demo version that works perfectly but when I try to export it into a runnable jar file that file doesn’t work.
I am using Serializable to store the state I need it to start in, which as I said works perfectly when started in Eclipse.
One thing that I noticed is that when I try to export it I get a warning message I have never seen before, maybe that is the reason? The message says as follows:

This operation repacks referenced libraries.
Please review the licenses associated with libraries you wish to reference to
make sure you are able to repack them using this application. Note also that
this operation does not copy signature files from original libraries to the
generated JAR file.

This error message did not appear if I changed the export setting from “Extract required libraries into the generated JAR” to “Package required libraries into generated JAR” but it made no difference. The program still didn’t work.
At least it seems like it didn’t crash, using the Task Manager it’s possible to see that the java virtual machine is running until you stop it and it doesn’t say that it’s not answering so it shouldn’t be completely crashed down.

Anyone has some ideas?

That’s not an error message, it’s just telling you what it’s doing, reminding you that you should make sure your’e allowed (licensed) to use the libraries you’re using.

I’m not quite sure what you mean about the Serializable business, except that I know Serializable is usually bad news and rather flaky, but you should run your program (the Jar) from the command line (or have some actual logging-to-file) to see what errors occur when the program tries to run. If it shows up in Task Manager but did not display a window, you’ve probably got some resource it can’t find or something, so it hangs.

Refresh your project. Eclipse might not be exporting some resources for you, because it doesn’t know they exist on the hard drive.

If that’s the issue, then fix it permanently with
Window > Preferences > General > Workspace > Refresh Using Native Hooks or Polling
and
Window > Preferences > General > Workspace > Refresh on Access

Check both of those.

(I highly doubt it was, as he said it worked in eclipse, but do this anyway)

This is what you do when you work with Libgdx, because libgdx uses some kind of internal file system. It needs to be refreshed. With LWJGL you probably are reading straight from the HDD so it doesn’t matter if the files are present in IDE’s memory or not.

Why isn’t there a facepalm emote?

There is no “internal filesystem” in libGDX, Gdx.files.internal (and the other functions) is an API shortcut that basically stands in for getClass().getResourceAsAtream() or similar.

I’m afraid it’s hard for me to check where it goes wrong. I have notifications right before and after I load the serialization-file and as I said they pop up perfectly when running in Eclipse but only the one before seems to pop up when I run it after exporting it

But for some reason you must refresh eclipse project for it to work. Try making changes to files that you load with .internal and you will see that they don’t change, even though you saved them. How is that even possible if you don’t have some kind of internal memory ?

@trollwarrior1
I’m terribly sorry but I’m afraid I don’t under stand what you mean. I don’t know if I load any files with .internal (I don’t even know what that is).
At least I have now been able to determine that the file is loaded as it should be and that the problem comes when I try to run the program.

I know for libGDX, projects often depend on eclipse linking the asset folders together, so eclipse has to know about those files, think about it like git, eclipse might not have “fetched” or “pulled” the latest changes, and so libGDX doesn’t see them, because it’s depending on eclipse to “show” your app the correct files.

Also, when eclipse exports any project, it probably only exports the files it knows about, so while your non-libGDX app could see through straight to the filesystem and it’s true state, on export files are missing because eclipse didn’t know about them at export time.
That or you’re just loading files wrong, which might be Anju’s problem.

So just set to refresh automatically, and never worry about that particular problem again.

Could you post the code that is between the notifications that seems to be causing problems?