You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::ffi::CString;use std::os::raw::{c_char, c_int};fnmain(){// Get the number of command line arguments.let argc = unsafe{letmut argc = 0;
std::getenv("argc").map(|s| s.parse().unwrap()).unwrap_or(argc);
argc
};// Get the command line arguments.let argv = unsafe{letmut argv = Vec::new();for i in0..argc {let arg = std::getenv(format!("argv{}", i)).unwrap_or("");
argv.push(CString::new(arg).unwrap());}
argv
};// Initialize the JVM.let status = unsafe{let status = jli_init(argc, argv.as_ptr());if status != 0{println!("Error initializing the JVM: {}", status);
std::process::exit(1);}
status
};// Launch the Java program.let status = unsafe{let status = jli_launch(argc, argv.as_ptr());if status != 0{println!("Error launching the Java program: {}", status);
std::process::exit(1);}
status
};// Terminate the JVM.unsafe{jli_term();}}extern"C"{fnjli_init(argc:c_int,argv:*const*constc_char) -> c_int;fnjli_launch(argc:c_int,argv:*const*constc_char) -> c_int;fnjli_term();}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: