Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Library doesn't want to load...  (Read 1129 times)
0 Members and 1 Guest are viewing this topic.
Offline toucansam

Junior Newbie





« Posted 2008-01-23 20:18:48 »

Ok so here's the deal. I'm trying to figure out what's wrong with loading jogl. This is for a plugin, so java.library.path is not always the same. So beforehand, I add the plugin directory path to java.library.path. I have it print out the paths, and so far so good:

String newLibPath = System.getProperty("java.library.path") + File.pathSeparator + libPath;
System.setProperty("java.library.path", newLibPath);


However when jogl loads, it says it cannot find jogl. This being strange, I try to move the libraries around. I put in this directory next (which was in java.library.path before i added the new directory):

/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources

which is very naughty i know and can cause problems. but this time the library loaded just fine. I've double checked things here so many times. Now i'm sure I can just work with it in the framework directory to just develop the plugin, but if I want to release it, this is not acceptable. For some reason, it can find the library in that old path, but not at the new path I added. I also tried loading it like this:

String nativ = System.mapLibraryName("jogl");
System.load(libPath+"/"+nativ);


which works to load it, but then jogl does not detect it and uses System.loadLibrary("jogl") so it doesn't work again.

another note, I tried immediately loading the library after I changed the path (I thought maybe the jogl loader had a different java.library.path property). This did not work, and it said it couldn't find the library again. But as last time, when I moved it to a directory previously on java.library.path, it worked.

I tried puting the libraries at the root directory / and added that to the path instead, but it still would not load them.

please post any ideas you might have, this is getting very frustrating
Offline Noya

Senior Newbie





« Reply #1 - Posted 2008-01-24 00:57:45 »

The java.library.path property cannot be modified at runtime (okay, it can, but it has no effect). The virtual machine has to know the library path at startup (I'm not sure why, I think it has something to do with native linking). You can use the -D option of java to set it.

Like:
java -Djava.library.path=/path/to/lib FooClass

Hope that helps Smiley
Pages: [1]
  ignore  |  Print  
 
 

 
ivj94 (583 views)
2018-03-24 14:47:39

ivj94 (47 views)
2018-03-24 14:46:31

ivj94 (374 views)
2018-03-24 14:43:53

Solater (61 views)
2018-03-17 05:04:08

nelsongames (108 views)
2018-03-05 17:56:34

Gornova (150 views)
2018-03-02 22:15:33

buddyBro (693 views)
2018-02-28 16:59:18

buddyBro (91 views)
2018-02-28 16:45:17

xxMrPHDxx (493 views)
2017-12-31 17:17:51

xxMrPHDxx (732 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!