I'm having a problem with LWJGL and I just can't seem to find a working solution. I'm developing a game for my university project and when I run the 'SimpleGame' code, I keep getting this error: 'Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path'
I have been looking for a solution for weeks and it just doesn't seem to want to work. I've copied the jar files to a 'lib' folder within my project and created a folder for the natives which contain the necessary DLLs and I've put everything in my build path and tried multiple combinations of VM arguments.
I'm at my wits end with this. Any help would be greatly appreciated. Thanks.
I worked it out. I copied the 'lwjgl' folder (containing docs, jars, natives folders, etc) into a folder within my project called 'lib'. I hope this helps someone else in future as I've been trying to find a working solution to this for ages.
I edited my VM arguments so they looked like this (can't post a screenshot because I don't have enough rep yet):
-Djava.library.path="lib\lwjgl"
-Djava.library.path="lib\lwjgl\jar"
-Djava.library.path="lib\lwjgl\native"
-Djava.library.path="lib\lwjgl\native\windows"
I also made sure that 'lwjgl.jar' and 'slick.jar' were added to my build path.
Again, I hope this helps! Many thanks to #Crynix for advising me to check my VM arguments.
Related
I have the Problem that i want to add OR-Tools into my project via eclipse IDE. I want to use the Linear Solver. I added the two jars form the downloaded Zip file. Now i want to run the SimpleLpExample from the OR-Tools site. I've got the Error that no jniortools in java.library.path. I see that at other posts they say you have to run make third_party and make java, but i don't know where i have to run these commands.
When somebody added it successfully into an IDE it would be glade when this person can explain how he does it. Thanks for help.
No. You need to add the path to the jniortools shared library I'm eclipse.
All dynamic libraries are located in the lib/ directory of the extracted archive.
To add the correct path, please follow these instructions:
Sorry for the crappy title.
I've been building games in Java since February, teaching myself as I go along. Recently, I worked on a dungeon crawler for over a month using Java FX, and I was quite pleased with the result. I was, in fact, so pleased with the game that I decided to publish it on my Game Jolt account, which I had previously used to produce games I made in Visual Basic.
I went through the process of building a .jar file as an Artifact in Intellij IDEA, and eventually, one was produced. When I tried to run the file however, it started to open but then crashed. I couldn't figure out why even after rummaging through my Console looking for errors to no avail (I'm using a Mac,) and after attempting to open the jar on a PC I found around the house, I concluded it was an error with the app. I soon found that I hadn't signed the jar, causing a security error, so I went through the process of trying to self-sign. When I tried to do that, it worked, but the jar still wouldn't open.
Evidently, there is a underlying issue with my app that needs to be remedied. I have no idea where to start looking, largely because I have tried several times to create new files, including a Hello World application, none of which resulted in a functioning application.
So, here's the entire project.
If any of you would like to have a look through it and point me in the right direction, I would appreciate it, and credit you on my Game Jolt page. This has been giving me headaches for far too long, and I'm about to give up and learn a new bloody language. Please help, it's always appreciated.
Sincerely, a 15-year-old Java-lover who just wants to produce a damn dungeon crawler, fgs.
UPDATE: As per #AndreyAkhmetov's advice, I removed the Class-Path from my manifest file. Unfortunately however, I still don't get anything opening when trying to launch the application. Hope this helps, everyone. Thanks for the feedback so far!
I have made a pull request to fix your game ;).
your problem is how to load resources. You can use maven to organize your project and resources. It helps to make your project platform independent and easy to share.
you should use this structure:
Crawler /
src /
main/
java/
resources/
Images/
pom.xml
The pom.xml is a configuration file and all your resources like Images are in the resources folder. Then you can load it using this:
InputStream loadimg = Main.class
.getClassLoader()
.getResourceAsStream("Images/chest.png");
chest.setImage(new Image(loadimg));
also you should change the directories where you load saved files, from this c\\... to this ./saved.txt. Then the jar can be executed from anywhere.
To create an artifact you can do
$ mvn package
or if you are using Intellij, in the side bar click on Maven then on lifecycle and package.
That will create a target folder with the jar inside, you can execute it by clicking on it or with this command to see the console errors.
java -jar Crawler.jar
Try to split your components from your Main class, it is too large and difficult to read and understand.
Nice game, good luck!
I am doing an image processing application. For that i am using OpenCV-300.jar file. But when i run the program it gives the UnSatisfiedLinkError. When I search for the win32-x86 folder which contain dll file required for the jar, It was not available inside build folder within the project. How can I solve this? I went through all the tutorials related to solving UnSatisfiedLinkError for the whole day. But non of them worked for me. Please help me. Thank you in advance
I have created an applet, which i aim to put online, i have created the HTML code for it and put the class files in the area, and i am running into issues, my applet uses the JUNG library, and i have been putting all the files individually up on to the web-space in the corresponding folders (I cannot put the whole library on the web-space as i do not have enough space)
However after going through many and getting the hang of putting them all in the right location, i am now stuck.
I have located what i believe is the right file ie FRLayout.class from the JUNG library and put it into the directory: edu/uci/jung/algorithms/layout/ however when i do and i try to run the applet i get the corresponding error:
RunTimeException:
java.lang.NoClassDefFoundError: edu/uci/jung/algorithms/layout/FRLayout (wrong name: edu/uci/jung/algorithms/layout3d/FRLayout)
Now this path directory actually does not exist on my webspace? and i have tried putting the file in here just in case that works but it didn't.
i wondered whether i had got the 3d version of the FRLayout, but i have checked the folders and i don't believe it is, i have also re-extracted the Jar file, but to no avail.
Really stuck
Any help would be appreciated.
Thanks
I have tried both the 3d and non-3d versions in the layout folder, however both provide me with the same runtime exception.
Really could use some advice, Thanks
I'm new to NetBeans and I cannot find the MANIFEST.MF that this link tells me there should be when I click "Clean and Build" in the IDE.
However, I only see a .jar file and a README.TXT. Anyone have any idea about this?
I am completely new to NetBeans, so simple terms would be much appreciated!
Also, when I run my project in the IDE, it creates and displays a jFrame but when I double click the jar file, nothing shows up. I have done setVisible() and I have set the default close operation, so that is not the problem. When I was searching for an answer, I found out that this could be because I did not specify my main class in my manifest. So this may be tied in with the top question so that is why I am combining these two questions.
Thanks in advance, guys!
I am using NetBeans 7.2 Beta
I realised that the manifest.mf file is not located in the "dist/" directory but in the root directory of the project. I am able to locate it now. However, I am still unable to figure out why the jar was not working. It is working now. Maybe my machine was just acting up or maybe I was using up too much RAM so my computer did not want to run another program? Anyway, everything is solved now. Thanks for everyone to answered!
Extract the .jar file using WinRar and then check inside the META-INF folder for MANIFEST.MF.