Running from terminal and running from jar

Started by Obsyd, June 16, 2014, 12:21:51

Previous topic - Next topic

Obsyd

Hi guys!

When I run my gl 3.3 code from the terminal everything is ok, but when I run the JAR by double clicking it the alpha values are simply not there.

Does anyone know why this could happen?
The shader files are outside of the JAR.

Thanks!

quew8

Quote from: Obsyd on June 16, 2014, 12:21:51
the alpha values are simply not there.

First off I have no idea what you mean by the above and, for a more precise response, I suggest you elaborate on the problem a little more.

Secondly. The problem I suspect is that you haven't linked the libraries and or natives properly. It is one thing to set it up in an ide, another to make a runnable jar. Make sure the libraries and natives are on the class path. I advise you to look into fat jars or there is an old (but still very useful) program called jar splice which was in fact originally designed for making self contained LWJGL builds.

Jar splice is probably your simplest option. Unless you want to automate the process (what kind of self respecting programmer wouldn't) in which case you will have to know a little of fat jars. I use NetBeans and making an ant target to do just that was very simple, I cannot speak for other build systems but I would imagine they would be equally simple.

abcdef

I use something to load the natives during run time so there is no configuration in netbeans (I use netbeans too).

Your problem definitely sounds environmental rather than programmatical

Obsyd

Thanks for the answers!

I too load the natives during runtime. My problem is a visual one. The alpha values that I submit for each vertex simply disappear (they are all 1.0) when I run my code by double clicking the JAR. If I do a java -jar something.jar from the terminal, the submitted alpha values are correct. This happens only on windows. On mac osx the alpha values are correct both ways.