a.bat PATH=C:\SDK-JAVA.20\BIN;%path% makefile # ------------------------------------------------------------------------------ # # Copyright (c) 1996-1997 Microsoft Corporation # # ------------------------------------------------------------------------------ SDKROOT = c:\sdk-java.20 TARGET = invokevm build = retail CC = cl.exe LINK = link.exe JVC = jvc.exe PACKROOT = .. JVCSW = CFLAGSALL = -c -I $(SDKROOT)\include LFLAGSALL = LIBS = $(SDKROOT)\lib\i386\msjava.lib !IF "$(build)" == "debug" CFLAGS = $(CFLAGSALL) -MLd -Zi -Fd$(TARGET).pdb LINKFLAGS = $(LFLAGSALL) -debug -pdb:$(TARGET).pdb !ELSE CFLAGS = $(CFLAGSALL) LINKFLAGS = $(LFLAGSALL) !ENDIF all : $(TARGET).exe TestClass.class $(TARGET).exe : $(TARGET).obj $(LINK) $(LINKFLAGS) $(LIBS) $(TARGET).obj -implib:$(TARGET).lib -out:$(TARGET).exe $(TARGET).obj : $(TARGET).c $(CC) $(CFLAGS) $(TARGET).c TestClass.class: TestClass.java $(JVC) TestClass.java invokevm.c #include #include #include void main() { ThreadEntryFrame th; ClassClass *pClass; PrepareThreadForJava(&th); pClass = FindClass(NULL, "TestClass", TRUE); execute_java_static_method(NULL, pClass, "someMethod", "()V"); //UnprepareThreadForJava(&th); } TestClass.java public class TestClass { public static void someMethod() { System.out.println("someMethod in TestClass called."); } }