# Thread: no jogl in java.library.path

1. ## no jogl in java.library.path

ok so I've got my file going.

it compiles perfectly, builds perfectly, and runs perfectly. All within Netbeans.

Everything works within netbeans.

(I have -djava path in vm options, I have the libraries in the compile and jogl in the run properties)

Once you build it gives the message

To run this application from the command line without Ant, Try:
Java -jar "c:\path\to\my\jar.jar"

When I run this from command I get

Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: No jogl in java.library.path

Why does my program work within netbeans but won't run the .jar with the command prompt?

2. Follow the JOGL installation instructions.

Place the .dll files in your JAVA_HOME/jre/bin directory.
Place the jars in your JAVA_HOME/jre/lib/ext directory.

Everything 'should' work then.

3. It seems that the jogl developers should have made an installer/updater.

4. Look at the build.xml, it contains a script for JOGL setup.
However, this part is commented out right now i think, because of the transition to JOGL 2 for which we are not ready yet.

5. ## Same issue, Java hurts...

Hey Guys,

I'm having the same issue, and I'm sure it's something relatively easy. I'm just trying to get involved with WorldWind Java...but coming from .NET, it hurts. Was anyone able to resolve the 'no jogl found in library path' error?

Any tips are greatly appreciated. I just want to be able to compile files and run them...

thanks,
Dan

6. it's been a while since I messed with this... however I no longer attempt to run it from the command prompt.

I create a JNLP file which basically tells the java application where it's resources live, and then I have a folder with all the jogl resources included (.dlls and jars).

7. If you have the .dlls (only two required) in the directory as your app in Win it should work.

In Linux, which does not automatically search the current dir:
-Djava.library.path=.
In Linux all the jogl files in the WWJ SDK are in the dir with the app, have not taken the time to see what can be omitted (.dll + ?).

I often run/suggest a .bat file for the app/s in Win.
I always use a .bash file in Linux (except tinkering on the command line)
-Xmx512m -Dsun.java2d.noddraw=true

You can run out of heap space with Java.

edit: Note that in Linux if you make a link to your app and move/drag the link to the desktop your .bash starts in that dir. A line in the .bash should cd to the dir where your app is.

cd /home/neil/WW
java -Xmx512m -Dsun.java2d.noddraw=true -Djava.library.path=. -jar NLNww.jar
read -p "end"

8. ## not yet

well, i've tried just about every combination of putting files in different places...not yet working. I've taken a look at the JNLP files that NASA has on their demos page...tried to modify one of those and it seems like it might almost work...but...i get signing errors. As for JOGL, I assume that it's ok to reference it by URL like NASA does in their JNLP files.

These are the reasons I've avoided JAVA for so long, just a pain to get apps working and distributed.

any other dev tips that you might have are greatly appreciated.

thanks,
Dan

9. geodan: Can you explain how you're trying to run WorldWind? Is it from the command line? On what operating system?

On Windows, a minimal WorldWind setup is:

Code:
C:\test>dir

Directory of C:\test

11/08/2010  03:02 PM    <DIR>          .
11/08/2010  03:02 PM    <DIR>          ..
11/08/2010  10:18 AM            20,480 gluegen-rt.dll
11/08/2010  10:18 AM            18,416 gluegen-rt.jar
11/08/2010  10:18 AM           315,392 jogl.dll
11/08/2010  10:18 AM         1,126,403 jogl.jar
11/08/2010  10:18 AM            20,480 jogl_awt.dll
11/08/2010  10:18 AM           114,688 jogl_cg.dll
11/08/2010  10:18 AM         6,279,828 worldwind.jar
I can run the basic WorldWind demo by executing:

Code:
C:\test>java -jar worldwind.jar
On Windows, Java looks in the current working directory for the native libraries. As nlneilson pointed out, this may not be the case on other systems. You can specify the native library directory with the -Djava.library.path flag, as in:

Code:
C:\test>java -Djava.library.path=. -jar worldwind.jar

10. ## what i'm trying to do

What I'm trying to do is take one of the examples, i.e. the Measure Tool Usage example...and separate it into its own project...that I can start testing/modifying and so forth.

Ideally, I'd be able to distribute something like the Measure Tool Usage example, on both Windows AND Mac.

I followed the instructions on the wiki, and I can "right-click" on the examples and they run within NetBeans...but...if I try to set the Main Class as the Measure Tool Usage example, it will run within netbeans, but I can't get the JAR file to execute via command line...nor if I create a JNLP file, I get a variety of errors, mostly to do with "signing".

These concepts are fairly new to me because I'm a .NET guy.

(tomorrow is another day I guess)

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•