Foro de elhacker.net

Programación => Java => Mensaje iniciado por: dato000 en 15 Febrero 2011, 18:37 pm



Título: No puedo correr el codigo por restriccion de libreria [SOLUCIONADO INSTALAR JDK]
Publicado por: dato000 en 15 Febrero 2011, 18:37 pm
buenas, no se que paso, tengo este mensaje:

Código:
java.lang.Error: Unresolved compilation problems:
Access restriction: The type JFrame is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JMenuBar is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JMenu is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JMenuItem is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JLabel is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JPanel is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JLabel is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JLabel is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The method getContentPane() from the type JFrame is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JPanel() is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JPanel is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type ImageIcon is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor ImageIcon(String) is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type ImageIcon is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JLabel(Icon) is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JLabel is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JLabel(String) is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JLabel is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JLabel(String) is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JLabel is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JMenuBar() is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JMenuBar is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JMenu(String) is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JMenu is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JMenuItem(String) is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JMenuItem is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JMenuItem(String) is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JMenuItem is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The constructor JMenuItem(String) is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JMenuItem is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The method add(JMenuItem) from the type JMenu is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The method add(JMenuItem) from the type JMenu is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The method addSeparator() from the type JMenu is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The method add(JMenuItem) from the type JMenu is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The method add(JMenu) from the type JMenuBar is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The method addActionListener(ActionListener) from the type AbstractButton is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The method addActionListener(ActionListener) from the type AbstractButton is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
OptionPane cannot be resolved
campo cannot be resolved
Access restriction: The method setDefaultCloseOperation(int) from the type JFrame is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The type JFrame is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar
Access restriction: The field EXIT_ON_CLOSE from the type JFrame is not accessible due to restriction on required library C:\Archivos de programa\Java\j2re1.4.2_03\lib\rt.jar

at claseprog1.Main.<init>(Main.java:7)
at claseprog1.Main.main(Main.java:98)
Exception in thread "main"

Es necesario publicar el codigo?? no se porque se dio este tipo de error, acabo de actualizar java y no se como correr el programa, tengo cuenta administrador (o eso creo, no es mi laptop, pero puedo hacer lo de una cuenta XP administradora).

me ayudan??


Título: Re: No puedo correr el codigo por restriccion de libreria
Publicado por: NetJava en 15 Febrero 2011, 18:44 pm
Buenas,
A lo mejor no tiene que ver esto, por ejemplo en Windows Vista me paso algo parecido, tuve que quitar "Alerta de seguridad de Windows" en cuanto a las preguntas que hace cada vez que quiere ejecutar alguna aplicación, y me funciono.

Suerte saludos!


Título: Re: No puedo correr el codigo por restriccion de libreria
Publicado por: dato000 en 15 Febrero 2011, 18:48 pm
Buenas,
A lo mejor no tiene que ver esto, por ejemplo en Windows Vista me paso algo parecido, tuve que quitar "Alerta de seguridad de Windows" en cuanto a las preguntas que hace cada vez que quiere ejecutar alguna aplicación, y me funciono.

Suerte saludos!

Gracias por responder, pues no creo que sirva de mucho, yo estoy usando XP, y al parecer no hay restricciones de seguridad de ese tipo.

alguien tiene otro dato??


Título: Re: No puedo correr el codigo por restriccion de libreria
Publicado por: dato000 en 15 Febrero 2011, 22:03 pm
Ya descubri el problema, era las librerias en si, estaban desactualizadas, instale el ultimo JDK de java (1.6) en la pagina de java

Código:
java_ee_sdk-6u1-jdk-windows-ml

solo era indicar en eclipse que libreria debia usarse, por si llega a pasar nuevamente dejo estos datos:

GUIA DE INSTALACION E IMPORTACION DE JDK PARA ECLIPSE:

(http://www.imaxenes.com/imagen/11is54zr.png.html)
(http://www.imaxenes.com/imagen/21qd122v.png.html)
(http://www.imaxenes.com/imagen/31yr99vu.png.html)
(http://www.imaxenes.com/imagen/41tn78o5.png.html)
(http://www.imaxenes.com/imagen/51od50zv.png.html)
(http://www.imaxenes.com/imagen/61sx34ke.png.html)
(http://www.imaxenes.com/imagen/71ac6588.png.html)
(http://www.imaxenes.com/imagen/81ga77s8.png.html)
(http://www.imaxenes.com/imagen/91or35hz.png.html)
(http://www.imaxenes.com/imagen/101fy79ra.png.html)