Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (487)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (553)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Cant figure out his error... Only happens on other peoples computers.  (Read 1369 times)
0 Members and 1 Guest are viewing this topic.
Offline Shane75776
« Posted 2012-04-28 21:59:06 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: com.melloware.jintellitype.JIntellitypeException: Could not load JIntellitype.dll from local file system or from inside JAR
        at com.melloware.jintellitype.JIntellitype.<init>(JIntellitype.java:114)
        at com.melloware.jintellitype.JIntellitype.getInstance(JIntellitype.java:174)
        at CaptureScreen.registerHotkeys(CaptureScreen.java:163)
        at CaptureScreen.<init>(CaptureScreen.java:100)
        at CaptureScreen.main(CaptureScreen.java:199)
        ... 5 more
Caused by: java.lang.UnsatisfiedLinkError: C:\Users\B\AppData\Local\Temp: Can't find dependent libraries
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary0(Unknown Source)
        at java.lang.ClassLoader.loadLibrary(Unknown Source)
        at java.lang.Runtime.load0(Unknown Source)
        at java.lang.System.load(Unknown Source)
        at com.melloware.jintellitype.JIntellitype.<init>(JIntellitype.java:99)
        ... 9 more


Thats the error that shows up on my friends computer. Basically what my program does is extract a dll file from itself and put it in the temp folder. It then loads it. (this is a windows key hook)

Anyways, my program runs flawlessly on my computer, but on my friends or anyone elses it throws this error at me. Does anyone have any idea what might be going on and why it does not happen on my computer?

Edit: This also makes it really hard for me to test.. as I have no way to know if I fixed it or not.

Check out my Snipping Tool++ ! An advanced snippet/screenshot/text uploading tool! Meant to replace the windows snipping tool.

Check out Pixel Rain My most recent Swing based game!
Offline Shane75776
« Reply #1 - Posted 2012-04-28 22:06:02 »

I just realized that I also get that error, but only if I run the program from the command line. However, if I double click the jar and run it that way, the program runs fine with no issues.

However, my friend was trying to run the jar like that and it didnt do anything, and when we ran it from the command line it gave him that error... so confused.

Check out my Snipping Tool++ ! An advanced snippet/screenshot/text uploading tool! Meant to replace the windows snipping tool.

Check out Pixel Rain My most recent Swing based game!
Offline Rorkien
« Reply #2 - Posted 2012-04-28 23:22:34 »

Sorry if i'm obvious, but:

You have some code made on IntelliJ that runs just fine on your computer, but when you try to run it on another computer it gives out some error.

Have you checked if that JIntellitype.dll is really inside the jar? Also, it is trying to load from C:\Users\B\AppData\Local\Temp
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Shane75776
« Reply #3 - Posted 2012-04-29 01:18:00 »

yea, I know its trying to load from there because thats where I set it to load from and to extract the dll to. I tried manually putting the dll in the jar but still no dice.

Check out my Snipping Tool++ ! An advanced snippet/screenshot/text uploading tool! Meant to replace the windows snipping tool.

Check out Pixel Rain My most recent Swing based game!
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #4 - Posted 2012-04-29 02:06:39 »

"Can't find dependent libraries"

Looks like that DLL depends on other DLLs which are installed on your system path when using IntelliJ, but not on others nor when you run it from command prompt.

Best way to test if it's true is to create a File object of that temp location and see what the 'exists()' method return. If the DLL file exists, that means the above assumption is correct. If it returns false, then I'm incorrect Smiley

Offline sproingie

JGO Kernel


Medals: 202



« Reply #5 - Posted 2012-04-29 02:21:46 »

Why is everyone assuming it's IntelliJ?  IDEA has no native components, if it were an IntelliJ thing, it would be com.jetbrains, and the only time you ever run into IntelliJ dependencies are at compile time if you use @NotNull and don't use some other JSR303 implementation.
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #6 - Posted 2012-04-29 02:27:20 »

OH! JIntellitype.dll is something completely unrelated from IntelliJ XD

Googling it, it seems to allow to access Windows specific behavior in your Java applications. It also seems that there is only 1 DLL needed, that one.

@OP, could you post some code on how you load the DLL?

Offline ReBirth
« Reply #7 - Posted 2012-04-29 03:28:03 »

It's true that some errors/exceptions from java can still let the application to run but lost of native?

extract to temp folder... don't tell me that your both OS are not same.

Offline Shane75776
« Reply #8 - Posted 2012-04-29 04:03:33 »

OH! JIntellitype.dll is something completely unrelated from IntelliJ XD

Googling it, it seems to allow to access Windows specific behavior in your Java applications. It also seems that there is only 1 DLL needed, that one.

@OP, could you post some code on how you load the DLL?

yea. here is how I am loading. first off, I attempt to extract the .dll from my jar and place it in the temp directory. I then load it after doing that. However, I still get that error. I also found that my extracting is creating a 0kb file... so its not really extracting it from the jar. or something.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
AccessController.doPrivileged(new PrivilegedAction<Void>()
      {
         @Override
         public Void run()
         {
            String dllName = "JIntellitype.dll";
            File tmpDir = new File(System.getProperty("java.io.tmpdir"));
            File tmpFile = new File(tmpDir, dllName);
            //if (!tmpFile.exists())
           {
               try
               {
                  InputStream in = ClassLoader.getSystemClassLoader().getResourceAsStream(dllName);
                  OutputStream out = new FileOutputStream(System.getProperty("java.io.tmpdir"));

                  byte[] buffer = new byte[8192];
                  int bytesRead;
                  while ((bytesRead = in.read(buffer)) != -1)
                  {
                     out.write(buffer, 0, bytesRead);
                  }

                  in.close();
                  out.close();

               } catch (Exception e)
               {
                  e.printStackTrace();
               }

            }
            System.load(tmpFile.getAbsolutePath());
            return null;
         }
      });

Check out my Snipping Tool++ ! An advanced snippet/screenshot/text uploading tool! Meant to replace the windows snipping tool.

Check out Pixel Rain My most recent Swing based game!
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #9 - Posted 2012-04-29 04:25:40 »

Aha! You are supposed to create a FileOutputStream on that File object! Not the folder! XD

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Shane75776
« Reply #10 - Posted 2012-04-29 04:27:52 »

Yea, I got it figured. That code I posted was causing a different issue. I forgot that I edited it. The so I reversed back to what I did have when it was writing the file correctly to begin with. Turns out it was not finding the file in my jar. I needed to have the .dll placed next to my class files and once I tried that it seemed to work.

Either way, thanks for your guys help!

Check out my Snipping Tool++ ! An advanced snippet/screenshot/text uploading tool! Meant to replace the windows snipping tool.

Check out Pixel Rain My most recent Swing based game!
Offline ra4king

JGO Kernel


Medals: 345
Projects: 2
Exp: 5 years


I'm the King!


« Reply #11 - Posted 2012-04-29 05:20:41 »

Or you could put the DLL at the root of the JAR file and use getResourceAsStream("/" + dllName);

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

TehJavaDev (17 views)
2014-08-28 18:26:30

CopyableCougar4 (26 views)
2014-08-22 19:31:30

atombrot (39 views)
2014-08-19 09:29:53

Tekkerue (36 views)
2014-08-16 06:45:27

Tekkerue (33 views)
2014-08-16 06:22:17

Tekkerue (22 views)
2014-08-16 06:20:21

Tekkerue (33 views)
2014-08-16 06:12:11

Rayexar (67 views)
2014-08-11 02:49:23

BurntPizza (45 views)
2014-08-09 21:09:32

BurntPizza (36 views)
2014-08-08 02:01:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!