PDA

View Full Version : eclipse , Access restriction



miko5054
July 17th, 2010, 11:43 AM
im trying a java code that will send mail from the code

i cant run it because im receiving this error and cant import method`s



import com.sun.corba.se.impl.protocol.giopmsgheaders.Mess age;
import com.sun.xml.internal.fastinfoset.sax.Properties;
import com.sun.xml.internal.messaging.saaj.packaging.mime .MessagingException;


Access restriction: The type Message is not accessible due to restriction on required library /usr/lib/jvm/java-6-openjdk/jre/lib/rt

thanks
miki

lykeion
July 17th, 2010, 12:35 PM
It sounds like you need to use Sun Java instead of OpenJDK.

Link: Eclipse and Sun Java (Sun JVM System Wide) (https://help.ubuntu.com/community/EclipseIDE#Sun%20JVM%20System%20Wide)

1. Enable partner repo:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"2. Install Sun Java 6 JDK
sudo aptitude install sun-java6-jdk3. Setup to use it as default (as described in above link)

miko5054
July 17th, 2010, 01:10 PM
i installed java-6 set it to defult ,removed the openjdk but same result...


Access restriction: The type Message is not accessible due to restriction on required library /usr/lib/jvm/java-6-sun-1.6.0.20/jre/

miko5054
July 17th, 2010, 01:19 PM
those import aren't in the original java Api so i dont to use them anyway

thanks for the support