I'm tring to run jar file from C++
I wrote this code:
#include "stdafx.h"
#include <iostream>
#include <strsafe.h>
#include <stdexcpt.h>
#include "jni.h"
#include <conio.h>
#include <Windows.h>
using namespace std;
#pragma comment (lib,"C:\\Users\\Hilla\\Documents\\Visual Studio 2012\\helloworld\\helloworld\\jvm.lib")
int main()
{
JavaVM *jvm;
JNIEnv *env;
JavaVMInitArgs vm_args;
JavaVMOption options[3];
options[0].optionString = "-Djava.compiler=NONE";
options[1].optionString="-Djava.class.path=C:\\Users\\Hilla\\Documents\\Visual
Studio 2012\\helloworld\\Debug\\hello.jar";
options[2].optionString="verbose.jni";
vm_args.version=JNI_VERSION_1_6;
vm_args.nOptions=3;
vm_args.options=options;
vm_args.ignoreUnrecognized=0;
int ret=JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
printf("hilla");
}
I work with the x64 compiler. I add the JVM lim to the system path.
And it's still giving me this error:
'helloworld.exe' (Win32): Loaded 'C:\Users\Hilla\Documents\Visual Studio 2012\helloworld\x64\Debug\helloworld.exe'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Program Files\Java\jdk1.7.0_45\jre\bin\server\jvm.dll'. Cannot find or open the PDB file.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\msvcp110d.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\msvcr110d.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\wsock32.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\msvcr100.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\winmmbase.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\nsi.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\nvinitx.dll'. Cannot find or open the PDB file.
'helloworld.exe' (Win32): Loaded 'C:\Program Files\NVIDIA Corporation\coprocmanager\detoured.dll'. Cannot find or open the PDB file. 'helloworld.exe' (Win32): Loaded 'C:\Program Files\NVIDIA Corporation\coprocmanager\Nvd3d9wrapx.dll'. Cannot find or open the PDB file.
'helloworld.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. Symbols loaded.
'helloworld.exe' (Win32): Loaded 'C:\Program Files\NVIDIA Corporation\coprocmanager\nvdxgiwrapx.dll'. Cannot find or open the PDB file.The program '[7688] helloworld.exe' has exited with code 0 (0x0).
How can I fix this?