Im trying to get a project with JOGL running and from second one I've run into problems. I have downloaded jogl-all.jar, gluegen-rt.jar and gluegen-rt-natives-windows-amd64.jar and jogl-all-natives-windows-amd64.jar version 2.3.2 from the release website of JOGL. I have extracted gluegen-rt.jar and jogl-all.jar, added them as a library to my project and put all the native files into lib/natives/windows-amd64. So far so good, I then set up a simple method doing the following:
System.out.println("Start");
GLProfile profile = GLProfile.getDefault();
System.out.println(profile.getImplName());
I hit the run button in IntelliJ and it printed "Start". Thats it. I started checking some logs, browsing the internet about that issue and suddenly, like 2 minutes later I realized in the corner of my eye that the output changed and it printed GL4bc. A little bit confused i thought this might be some IntelliJ related issue or so and started it in the command line. Same thing there, it consistently takes 1-2 minutes to execute GLProfile.getDefault(). What's this madness? I mean, I never choose Java for performance reasons, but that's a little bit too much :D.
What am I missing here? Or is this 'as designed'? Thanks for any help in advance and have a nice day!
Related
I originally posted this question on GameDev stackexchange however I'll also ask the question here to try and get more outreach, especially since I wasn't sure my problem was specific to game development since it's a problem with a Java native call.
For the past months I've been working on creating my own game engine for personal use in LWJGL using pieces here and there, especially from developer ThinMatrix's rightfully credited code, to learn as much as I can while building it. Only recently there has been strange behavior happening when I launch the engine from IntelliJ for testing:
After about 6-10 individual times I click run, all subsequent runs suddenly take about 60 seconds for the window to appear.
Whenever I restart my PC this hanging resets and I have another 6-10 runs before it hangs everytime again.
I located the issue to glfwInit, more specifically at the call to the native method:
#NativeType("int")
public static boolean glfwInit() {
long __functionAddress = Functions.Init;
return invokeI(__functionAddress) != 0; // Right here
}
I also noticed that this issue only started when I attempted to implement text support in my engine using the STBTrueType library. It was perfectly fine before that. I tried removing the TrueType code but it didn't fix it.
Here's a list of things I've tried:
Clearing my temp folder in case a buggy or corrupted file was present.
Recompiling and rebuilding the entire LWJGL jars twice.
Building glfw.dll from the GLFW sources and replacing the glfw.dll in the native jars with the former.
Reinstalling Java and actually upgrading JDK versions (from 13.0.2 to 14.0.2)
Switching IDEs even if I suspected it wouldn't work.
Updating my NVIDIA drivers, and reinstalling them.
I'm quite confused as to what it could be, and I'd be more than happy to share code, thread dumps, or debug info if you deem it necessary. Here is the Github repository with the latest, "faulty" code (fault in quotes because I'm not too sure the code is the problem.)
Thank you very much for any guidance.
P.S: Please tell me if this is better asked in StackOverflow instead of here.
So I fixed the issue, it turns out it wasn't even related to anything to do with programming, or STBTrueType, or the library itself. The problem was as pointed out in this StackOverflow post, where this hanging behavior was due to a faulty driver or, in my case, my keyboard USB being plugged in the "wrong" USB port. I moved my computer at the same time I started working on text in my engine, hence why I wrongly linked the issue with the TrueType library. If you're having the same issue, look at the aforementioned post or if that doesn't work, look for a peripheral that might cause interference.
For quite some time I have encountered this issue that when doubleclicking a runnable .jar file it won't execute. Today I thought I'd have a look into solving this issue and read a bit through various SO articles regarding this topic.
First of all I have to say the following:
The problem occurs on my company's notebook running WIN 8 as well as on
my private WIN 10 desktop
I'm pretty sure about 1.5 - 2 years ago on the laptop doubleclicking worked
On the desktop however even directly after installation (which was in October last year) doubleclicking didn't work and it might be that I even already tried fixing the issue by reinstalling the JRE
As opposed to many situations described in various posts I can properly run the applications by calling "java -jar application.jar" in cmd but doubleclicking AS WELL AS trying to "open with" Java SE platform binary results in nothing happening
As suggested by several posts I tried running Jarfix however now the behaviour is as follows:
I had written a client-server application for my bachelor thesis which worked perfectly fine, I actually ran the application yesterday through cmd. After using Jarfix I'm now able to start the server by doubleclicking whereas the client side won't do anything when doubleclicked. I already checked for the correct filetype association as described in this post and everything looks correct.
Also I of course checked this with different programs as well and not only with my own applications. The same issue also appears for example (on my WIN 10 desktop) when trying to run Life in the Woods (for those not knowing it, it's a quite popular Minecraft mod pack) whereas it worked perfectly fine on my previous WIN 10 desktop when doubleclicking.
The problem that I have with this issue is not that I'd not be able to bypass it by running cmd commands but on the one hand it's simply annoying to always cd to the desired location and run this command and on the other hand it's simply something that has to definitely work after installing a JRE. It doesn't make any sense that for most people it works and for some few people random stuff happens - all more or less under the same conditions, that's not how any kind of software should behave.
I'd be really happy if anyone could help me solving this or point me towards anything I might have overlooked and forgot to check.
EDIT:
As pointed out by #VGR file operations using relative paths might be the reason for the problem hence below the two cases where file operations are being used:
Server-side:
File file = new File("C:/Util/authHashes.lvs");
Client-side:
systemProperties.put("javax.net.ssl.keyStore", "C:/Util/auth/labkey.jks");
systemProperties.put("javax.net.ssl.keyStorePassword", "password");
systemProperties.put("javax.net.ssl.trustStore", "C:/Util/auth/labtrust.jks");
What is weird is that both classes use absolute paths but the server starts when doubleclicking while the client does not. If both use the same kind of path shouldn't they both behave exactly the same?
Hello Stackoverflow Community!
I am facing a problem,
when I want to execute my self-written JavaFX runnable Jar file program (it is a Chess game).
When I execute the program it needs about ten seconds to start.
After the start, when I want to select a piece or the menu items there are two possible options:
The Gui freezes completely after startup
I may click on a piece and it needs around 5 sec. to select it and when I want to hover (no self-written event) on the JavaFX menubar, the PI freezes for about 5 sec. and then displays the blue hover color.
I have a Raspberry PI 3.
I have currently installed the Java Environment: ,,openjdk version "1.8.0_40-internal" ($ java -version)
I added manually the JavaFX files (they are not included in this openjdk version) as it is mentioned at:Gluonhq -section 2.1.4
I run the Jar file with: java -jar Chess.jar -> Chess.jar is jar file
The game runs without these errors on Linux Mint (openjdk version "1.8.0_131") and Windows 10.
I don´t know what is the source of the problem. Maybe JavaFX on the PI is simply not a good idea?
Anyway thanks for the help,
Alex
Thanks for your quick answers and suggestions, but today I found the solution (tldr; including images of the meeples lead to exceptions, which lead to a bad performance. Removing the images improved the performance):
#Joe C - with my next question I will specify the problem more clearly ;)
#sillyfly - no but thx. for your answer
#Josê - Yes I tried. The first program I used gave me the same bug, but today I tried another self-written one -> this one worked fine -> see below
The problem was that the PI couldn't render my Meeples (they were basically images). I found this out using the stack trace of the PI. Two days ago I couldn´t access the stack trace, due to an impossibility of exiting the game, now I developed an exit function, and here goes the stack trace. It showed me, that there is a null pointer at com.sun.prism.impl.BaseGraphics.drawTexture(BaseGraphics.java:4000) - this is for rendering Images (as far as I know).
Today I removed my meeple images. I don´t know why the PI can´t render these images but it works fine now :)
-Alex
I've just started to mess around with red5 , I can't say it was easy to get it run at the first place, but after a day on google I finally succeed.
The first thing I had to face is the poor documentation of this server. I couldn't find any good tutorials about making apps (I would pay for a good one, but still nothing) for it, but it doesn't matter since it's free.
I found this : Adobe TV . It's the best starting point I could find so far. The only thing is that I can't set up the same working enviroment as the guy has in the video. I understand it is eclipse (i have that) , and i know he is using flex plugin, but how do I get eclipse to debug mxml files as he does? (around 3.20 in the video) . I downloaded the flex plugin, but after I install it, eclipse stays exactly the same as before.
PLease note I am new to eclipse (and JAVA and flash -huhh... :D - ).
I am running Windows 7 Ultimate 32bit.
Any help would be greatly appreciated.
There is one more IDE called FDT for flex app development. They are using eclipse. Worthy to try this IDE http://fdt.powerflasher.com/ this is available linux too. This is does not support red5 by native. But you can just simply create as java project.
I prefere the Flex Development to do with flashdevelop: http://www.flashdevelop.org/
it is a very nice openen source code editor. Configuration is really easy and takes just 1 Minute. The only thing to do is to configure the path of the flex sdk. Debugging is nice and i love the code completition feature.
I have been working with the Play! Framework for a few weeks now, and am really enjoying it. Occasionally I have an issue come up which is frustrating me. It starts when I encounter a compile error. I refresh, and see the (excellent) Play! error message. Here's a simple example.
I go to the appropriate file, fix the error, and reload the page. Then I get this compiler error:
Strangely, it shows the updated source code, with the bug fix, but it is throwing the same compiler error from the previous message. If I restart the Play! server, then everything compiles and I can go on as expected, but of course one of the great things about Play! is being able to edit .java source files and see those changes right away in the browser.
Would really appreciate a tip from anyone who's bumped into this before, or has a clue what is causing it! Thanks so much! I am running OSX 10.6.
EDIT
I have also tried manually deleting the tmp/ directory, where the .class files are stored. This does not help, and I get the same behavior, where the edited source code appears, but the old compiler error is still dsiplayed.
My best stab at this is that your clock is screwed up. Do you use time synchronization? Keep a terminal open running:
while true; do sleep 1; date; done
and check whether there is a correlation with clock changes and this behaviour.
FWIW, I've never witnessed this (also on MacOS 10.6)