midnight armadillo
(1000+ posts)
Send PM |
Profile |
Ignore
|
Wed Jul-14-04 01:49 PM
Original message |
Java programming question |
|
I have a Java program...when run under Linux and Unix, it runs fine.
Under Windows, with the same version(s) of the Sun Java JRE, it silently exits after the creation of the first object.
The main goes something like this:
public static void main (String [] args) { // Does some config file stuff
// Somewhere in this line it silently fails MyObject obj = new MyObject(some,params,etc) ;
// Other stuff with output }
Any clues? This one is TOTALLY stumping me. I tried adding a System.out.println statement to the first line of the constructor for the object being created, but it quits before then.
Only under Windows. Runs flawlessly on Linux and Solaris, and there is nothing in this that is system-dependent.
|
Commie Pinko Dirtbag
(1000+ posts)
Send PM |
Profile |
Ignore
|
Wed Jul-14-04 01:51 PM
Response to Original message |
1. Not a Java guru but... |
|
...can't you try with a different JVM? Like from IBM for example?
Also, what's in the code of MyObject's constructor?
|
Ready4Change
(1000+ posts)
Send PM |
Profile |
Ignore
|
Wed Jul-14-04 01:57 PM
Response to Reply #1 |
2. Yah, something in MyObject |
|
I'm not real fluent in Java yet, but it's somewhere in there.
|
DS1
(1000+ posts)
Send PM |
Profile |
Ignore
|
Wed Jul-14-04 01:59 PM
Response to Original message |
3. I'm really really rusty, but... |
|
shouldn't it read:
MyObject obj = new obj(some,params,etc) ;
|
midnight armadillo
(1000+ posts)
Send PM |
Profile |
Ignore
|
Wed Jul-14-04 02:03 PM
Response to Original message |
4. Ah, it's some sort of JNI problem |
|
Somewhere in the object created, it creates another object which loads a compiled JNI library: static { try { System.loadLibrary( "gsl_root" ); } catch( UnsatisfiedLinkError e ) { e.printStackTrace(System.err) ; System.exit(1) ; } catch (SecurityException x) { x.printStackTrace(System.err) ; System.exit(1) ; } }
But this is where it fails...a 'println' shows it gets as far as trying to load the library and it silently quits. If I delete the library file 'gsl_root.dll' I get the UnsatisfiedLinkError exception.
Stupid frickin' windows. I am still stumped.
|
DU
AdBot (1000+ posts) |
Thu Apr 18th 2024, 01:27 PM
Response to Original message |