Sonntag, September 05, 2010

some Java and Eclipse pitfalls on OS X

Could not compile Java code importing com.sun.net.httpserver.HttpServer. The error message is: Access restriction: Class is not accessible due to restriction on required library

fix: go to teh Java compiler sttings and open Errors/Warnings. Check the Deprecated and restricted API and change from Error to Warning.


Check downloaded files with ll -@ for com.apple.quarantine. Remove with sudo xattr -d com.apple.quarantine.


Some JNI libs need to be recompiled for Snow Leopard. Check with file for Mach-O 64-bit bundle x86_64.


Use System.out.println(System.getProperty("java.library.path")); in the line before the line before the class is loaded. Check if the library is in one of the paths listed. On OS X use /Library/Java/Extensions/.

Keine Kommentare: