1

I am developing using Eclipse under Fedora 15. I exported a runnable jar. It works fine in Fedora. But I can't run it on windows. I have installed a JRE. I even tried installing JDK. There are no error logs, app just didn't start.

Here's the output

Microsoft Windows [Version 6.1.7601] (c) Корпорация Майкрософт (Microsoft Corp.), 2009. Все права защищены. C:\Users\Артоюрос>java -jar C:\Lib.Ru2Epub.jar 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(JarRsrcLoa der.java:58) Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons: no swt-gtk-3735 in java.library.path no swt-gtk in java.library.path Can't load library: C:\Users\└ЁЄю■Ёюё\.swt\lib\win32\x86\swt-gtk-3735.dl l Can't load library: C:\Users\└ЁЄю■Ёюё\.swt\lib\win32\x86\swt-gtk.dll at org.eclipse.swt.internal.Library.loadLibrary(Library.java:285) at org.eclipse.swt.internal.Library.loadLibrary(Library.java:194) at org.eclipse.swt.internal.C.<clinit>(C.java:21) at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63) at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54) at org.eclipse.swt.widgets.Display.<clinit>(Display.java:132) at ru.lib.epub.MainWindow.main(MainWindow.java:28) ... 5 more C:\Users\Артоюрос> 
3
  • 6
    To see possible error messages, open a commandline window and run your application using java -jar your.jar (do not simply double click the .jar file) Commented Jul 24, 2011 at 15:47
  • @a_horse_with_no_name added output. it seems theres osmething with SWT lib, but idk what exactly. Commented Jul 24, 2011 at 16:14
  • 1
    You need to copy the SWT runtime libraries so that your program can find them. SWT is not part of a standard Java installation it's a (native) library from Eclipse. Commented Jul 24, 2011 at 20:10

4 Answers 4

2

As @a_horse_with_no_name said "open command prompt and run java -jar your.jar". If it works you have to map extension *.jar to program named "java". This is how windows works. The same mechanism is working when double click on *.txt file starts Notepad.

Since I am on linux now I cannot tell you how to map the extension to program but it is somewhere in menus of file explorer.

Sign up to request clarification or add additional context in comments.

Comments

1

it should be a runnable jar , so you can run it on windows using double click.

Comments

1

you may be referencing a resource using absolute path.. since you say you developed the app on Linux. you might have said new File("/etc/fstab");.. this would fail on windows as it does not have a file system like this.

this would usually be the case.

1 Comment

Actually your example is not correct, if this is executed on windows /etc/fstab can be created on the drive with the java vm provided there are no permission problems
1

There is a problem with swt dlls.

  1. check if the file C:\Users\└ЁЄю■Ёюё.swt\lib\win32\x86\swt-gtk.dll exists
  2. maybe you can't load it coz u don't have admin privileges? Then Goto Eclipse installation path, right click on eclipse.exe and select "Properites". From the eclipse.exe Properties pop-up select "Compatibility" tab and at the bottom of the tab check the following check box "Run this program as administrator" in "Previlege Level" category. This should solve the problem.
  3. Sometimes simply adding dlls into lib folder helps

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.