Democratic Underground Latest Greatest Lobby Journals Search Options Help Login
Google

Java programming question

Printer-friendly format Printer-friendly format
Printer-friendly format Email this thread to a friend
Printer-friendly format Bookmark this thread
This topic is archived.
Home » Discuss » The DU Lounge Donate to DU
 
midnight armadillo Donating Member (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.
Printer Friendly | Permalink |  | Top
Commie Pinko Dirtbag Donating Member (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?
Printer Friendly | Permalink |  | Top
 
Ready4Change Donating Member (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.
Printer Friendly | Permalink |  | Top
 
DS1 Donating Member (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) ;
Printer Friendly | Permalink |  | Top
 
midnight armadillo Donating Member (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.
Printer Friendly | Permalink |  | Top
 
DU AdBot (1000+ posts) Click to send private message to this author Click to view 
this author's profile Click to add 
this author to your buddy list Click to add 
this author to your Ignore list Thu Apr 18th 2024, 01:27 PM
Response to Original message
Advertisements [?]
 Top

Home » Discuss » The DU Lounge Donate to DU

Powered by DCForum+ Version 1.1 Copyright 1997-2002 DCScripts.com
Software has been extensively modified by the DU administrators


Important Notices: By participating on this discussion board, visitors agree to abide by the rules outlined on our Rules page. Messages posted on the Democratic Underground Discussion Forums are the opinions of the individuals who post them, and do not necessarily represent the opinions of Democratic Underground, LLC.

Home  |  Discussion Forums  |  Journals |  Store  |  Donate

About DU  |  Contact Us  |  Privacy Policy

Got a message for Democratic Underground? Click here to send us a message.

© 2001 - 2011 Democratic Underground, LLC