Jump to content

UnsatisfiedLinkError

- - - - -

  • Please log in to reply
12 replies to this topic

#1
PicklishDoorknob

PicklishDoorknob

    Learning Programmer

  • Members
  • PipPipPip
  • 86 posts
import javax.swing.*;


public class GooeyGUI {


	/**

	 * @param args

	 */

	public static void main(String[] args) {

		JFrame frame1 = new JFrame("The Frame");

		frame1.setSize(300, 300); 

		frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 

		[COLOR="#FF0000"]frame1.setVisible(true); //this gives an UnsatisfiedLinkError[/COLOR]	}

	

}

Why does the red line give that error?

All I'm trying to do is to make an empty JFrame.

#2
Cruel Hand

Cruel Hand

    Learning Programmer

  • Members
  • PipPipPipPip
  • 109 posts
  • Programming Language:Java
  • Learning:Java, Visual Basic .NET
which IDE/compiler are you using? It works for me.

#3
PicklishDoorknob

PicklishDoorknob

    Learning Programmer

  • Members
  • PipPipPip
  • 86 posts
I am using Eclipse.

EDIT: I tried something new:

import javax.swing.*;


public class GooeyGUI {


	/**

	 * @param args

	 */

	public static void main(String[] args) {

		JFrame frame1 = new JFrame("The Frame");

		frame1.setSize(300, 300); 

		frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 

		try {

			frame1.setVisible(true); //this gives an UnsatisfiedLinkError

		} catch (UnsatisfiedLinkError e) {

			System.out.println("Error!");

			try{

[COLOR="#FF0000"]				frame1.setVisible(true); //????? Now here I get a NoClassDefFoundError![/COLOR]			                   } catch (UnsatisfiedLinkError f) {

				System.out.println("Tried again, didn't work.");

			}

		}

	}

	

}

(Sorry, the formatting went a little weird.)

#4
lethalwire

lethalwire

    while(false){ ... }

  • Members
  • PipPipPipPipPipPipPip
  • 748 posts
  • Programming Language:Java, PHP
  • Learning:Java, PHP
Have you tried making sure everything under your Build Path looks right? Here's a screen of mine:
Attached File  java build path.png   91.81K   31 downloads

#5
PicklishDoorknob

PicklishDoorknob

    Learning Programmer

  • Members
  • PipPipPip
  • 86 posts
Like so?
[ATTACH=CONFIG]4390[/ATTACH]

#6
lethalwire

lethalwire

    while(false){ ... }

  • Members
  • PipPipPipPipPipPipPip
  • 748 posts
  • Programming Language:Java, PHP
  • Learning:Java, PHP
I can't see your attachment. I googled around and it seems it has something to do with eclipse and it not being able to find native libraries. You have tried researching the problem yet? If so, what have you tried so far?

#7
PicklishDoorknob

PicklishDoorknob

    Learning Programmer

  • Members
  • PipPipPip
  • 86 posts
The words
Attachment 4390
in the previous post are a hyperlink.

I tried researching it but I couldn't find anything about it.

#8
Cruel Hand

Cruel Hand

    Learning Programmer

  • Members
  • PipPipPipPip
  • 109 posts
  • Programming Language:Java
  • Learning:Java, Visual Basic .NET
i would try re-downloading eclipse? thats what I'm using too and your code compiled and ran just fine.

#9
PicklishDoorknob

PicklishDoorknob

    Learning Programmer

  • Members
  • PipPipPip
  • 86 posts
Oh, here's the build path: Attached File  likeThis.PNG   57.85K   22 downloads
(Wait for it to load or just click there)

EDIT: This might help:
Exception in thread "main" java.lang.UnsatisfiedLinkError: sun.awt.windows.WFramePeer.initIDs()V
at sun.awt.windows.WFramePeer.initIDs(Native Method)
at sun.awt.windows.WFramePeer.<clinit>(Unknown Source)
at sun.awt.windows.WToolkit.createFrame(Unknown Source)
at java.awt.Frame.addNotify(Unknown Source)
at java.awt.Window.show(Unknown Source)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at GooeyGUI_Test.main(GooeyGUI_Test.java:21)


Need help quick!

Line 21 is
frame.setVisible(true);

Edited by PicklishDoorknob, 15 December 2011 - 01:52 PM.


#10
lethalwire

lethalwire

    while(false){ ... }

  • Members
  • PipPipPipPipPipPipPip
  • 748 posts
  • Programming Language:Java, PHP
  • Learning:Java, PHP
Try this:
gui - java UnsatisfiedLinkError awt.image - Stack Overflow

It's seems it might be either something wrong with your classpath, or a corrupt java installation.

#11
PicklishDoorknob

PicklishDoorknob

    Learning Programmer

  • Members
  • PipPipPip
  • 86 posts
My Java re-installation said:
Attached File  popupnumber2.PNG   7K   5 downloads

Erm...

Attached Files



#12
lethalwire

lethalwire

    while(false){ ... }

  • Members
  • PipPipPipPipPipPipPip
  • 748 posts
  • Programming Language:Java, PHP
  • Learning:Java, PHP
Wow that's a weird one. Try running a registry cleaner (like CCLeaner) and removing the java installation from CCLeaner after running the registry cleaner. Then try to reinstall.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users