Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting Java version in Java Bridge for a foundation tool?



Hey all,

I'm trying to use the Java Bridge in a foundation tool, but Obj-C insists on
initializing Java 1.3 by default and my jar files require Java 1.4.  See
sample code below:

################################

#import <Foundation/Foundation.h>
#import <JavaVM/JavaVM.h>

int main (int argc, const char * argv[]) {
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    [[NSJavaVirtualMachine alloc] init];
    Class systemClass = NSClassFromString(@"java.lang.System");
    NSLog(@"java.version=%@", [systemClass getProperty: @"java.version"]);

    [pool release];
    return 0;
}

################################

I've seen some suggestions for using Java 1.4 in a Cocoa app, but I haven't
seen any information about using Java 1.4 in a foundation tool.  Has anyone
done this successfully?

- Morgan


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.