2 messages in net.java.dev.jna.usersJNA beginner: Problem to get "FileUti...
FromSent OnAttachments
aumasterApr 4, 2008 5:25 am 
Timothy WallApr 4, 2008 6:18 am 
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:JNA beginner: Problem to get "FileUtils" sample running - Please help...Actions...
From:aumaster (auma@gmx.net)
Date:Apr 4, 2008 5:25:14 am
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.java 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?