1 message in net.java.dev.jna.usersProblem running "FileInfo" sample
FromSent OnAttachments
Michael MerholdApr 3, 2008 3:27 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Problem running "FileInfo" sampleActions...
From:Michael Merhold (mich@web.de)
Date:Apr 3, 2008 3:27:28 pm
List:net.java.dev.jna.users

Hi,

sorry, i'm just beginning using JNA and i have a problem to get the "FileInfo" sample running...

1.) I downloaded the JNA sources from svn

2.) I made a new project with "IntelliJ" for testing the FileInfo sample

3.) I copied following files to the project to run the sample (and removed line "package com.sun.jna.examples.win32;" in source files) - FileUtils.java - Shell32.java - W32API.java - W32Errors.java - jna.jar

4.) I created a start file to call FileUtils named "FileUtilsTest.java" with the following content: public static void main(String[] args) { FileUtils fu = FileUtils.getInstance(); File[] fileArr = new File[] { new File("trashTest.fil") }; fu.moveToTrash(fileArr); }

5.) Trying to compile gives following error: Cannot resolve symbol 'SHFILEOPSTRUCT'

6.) So i rearranged Shell32.java that the compiler finds the Shell32 inner class SHFILEOPSTRUCT

7.) Compiling is ok, but now there's following error:

Exception in thread "main" java.lang.Error: Exception reading field 'hwnd' in class SHFILEOPSTRUCT: java.lang.IllegalAccessException: Class com.sun.jna.Structure can not access a member of class SHFILEOPSTRUCT with modifiers "public"

Is there anyone out there who can submit a working example for the "FileUtils" or can give a hint what's wrong?

Tia, mmdeveloper