Changeset 4700


Ignore:
Timestamp:
12/18/08 17:24:41 (11 years ago)
Author:
curtis
Message:

Link JVM library properly, and add a couple stock Jace examples.

Location:
trunk/components/bio-formats-jace
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/components/bio-formats-jace/CMakeLists.txt

    r4699 r4700  
    1919 
    2020find_package(JNI) 
    21 message("  jawt lib      : ${JAVA_AWT_LIB_PATH}") 
    22 message("  jvm lib       : ${JAVA_JVM_LIB_PATH}") 
     21message("  jawt lib      : ${JAVA_AWT_LIBRARY}") 
     22message("  jvm lib       : ${JAVA_JVM_LIBRARY}") 
    2323message("  jni.h         : ${JAVA_INCLUDE_PATH}") 
    2424message("  jni_md.h      : ${JAVA_INCLUDE_PATH2}") 
     
    4949add_executable(showinf source/showinf.cpp) 
    5050 
    51 target_link_libraries(showinf bfjace jace) 
     51target_link_libraries(showinf bfjace jace ${JAVA_JVM_LIBRARY}) 
     52 
     53### TEMP - build some Jace examples for testing ### 
     54 
     55add_executable(example1 source/example1.cpp) 
     56target_link_libraries(example1 bfjace jace ${JAVA_JVM_LIBRARY}) 
     57 
     58add_executable(array_example source/array_example.cpp) 
     59target_link_libraries(array_example bfjace jace ${JAVA_JVM_LIBRARY}) 
  • trunk/components/bio-formats-jace/source/showinf.cpp

    r4696 r4700  
    1919#include "jace/proxy/types/JBoolean.h" 
    2020using jace::proxy::types::JBoolean; 
     21 
     22#include "jace/proxy/types/JByte.h" 
     23using jace::proxy::types::JByte; 
    2124 
    2225#include "jace/proxy/java/lang/String.h" 
     
    4750    StaticVmLoader loader(JNI_VERSION_1_4); 
    4851    OptionList list; 
    49     list.push_back(jace::ClassPath("jace-runtime.jar")); 
    50     list.push_back(jace::ClassPath("bio-formats.jar")); 
     52    list.push_back( jace::ClassPath( "jace-runtime.jar:bio-formats.jar" ) ); 
    5153    list.push_back(jace::CustomOption("-Xcheck:jni")); 
    5254    list.push_back(jace::CustomOption("-Xmx256m")); 
     
    5456    cout << "JVM created." << endl; 
    5557 
    56     //ImageReader r(); 
    57     JArray<String> args(argc); 
    58     for (int i=0; i<argc; i++) args[i] = argv[i]; 
    59     JBoolean result = ImageInfo::testRead(args); 
    60     //ImageReader r(); 
    61     //JBoolean result = ImageInfo::testRead(r, args); 
     58    cout << "Arguments:" << endl; 
     59    for (int i=0; i<argc; i++) cout << "\t#" << i << ": " << argv[i] << endl; 
    6260 
    63     return result ? 0 : 1; 
     61    //typedef JArray<String> StringArray; 
     62    //StringArray args(argc - 1); 
     63    //for (int i=1; i<argc; i++) args[i - 1] = argv[i]; 
     64    //JBoolean result = ImageInfo::testRead(args); 
     65 
     66    if (argc < 2) { 
     67      cout << "Please specify a filename on the command line." << endl; 
     68    } 
     69    else { 
     70      String id = argv[1]; 
     71      cout << "Initializing " << id << endl; 
     72      //ImageReader r(); 
     73      //r.setId(id); 
     74      //int w = r.getWidth(); 
     75      //int h = r.getHeight(); 
     76      //cout << "Image planes are " << w << " x " << h << endl; 
     77      //r.openBytes(0); 
     78      //JBoolean result = ImageInfo::testRead(r, args); 
     79 
     80      //return result ? 0 : 1; 
     81    } 
    6482  } 
    6583  catch (FormatException& fe) { 
Note: See TracChangeset for help on using the changeset viewer.