Java – NoClassDefFoundError using jna.jar and platform.jar

internet-explorer-9javajava-native-interfacejnaswing

I need to find a way to change the settings of proxy on the IE 9.

I know a way directly in the reg., but ie9 doesn't refresh after I set them.
I tried to use another solution with jna:

Invoke WinInet Functions Used Java + JNA

In my case I use only:

System.out.println("Set refreshed...");

if (!WinInet.INSTANCE.InternetSetOption(
    hInternet, WinInet.INTERNET_OPTION_REFRESH, (Pointer) null, len)) {
        System.out.println("InternetSetOption failed!:"
            + Kernel32.INSTANCE.GetLastError());

but I get this error:

Set refreshed...
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
    com/sun/jna/platform/win32/WinDef$DWORD

I downloaded the lib jars from here:

http://java.net/projects/jna/downloads/directory/3.3.0

Thank you.

Best Answer

makesure you have platform-3.4.0.jar and jna-3.4.0.jar in your classpath