Results 1 to 12 of 12
  1. #1
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default runable . jar in linux

    Hi all

    I have made my first javaprogram in eclipse (installed on Vista). It is possible to make a runable .jar file which run on Vista. Now I want to run the same program on Linux Linpus (on Acer Aspire One). I cant use the runable .jar file from Vista because it dont run on other systems.

    I am fairly new to linux so I would prefer to make something from eclipse on Vista which can run on linux. Is it possible or do I have to install eclipse on linux (seemes not easy) and make a runable .jar in that way.

    What can I do? Anything pointing me in the right direction would be appreciable.

    Thank you in advance.
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

  3. #3
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default

    Hi Furable

    Thanxs for your quick answer.

    When I make the runnable in Eclipse and choose "Runnable JAR file" under "Java" in the "Export"-window, the discription says "Export resources into a JAR file on the local file system"

    and

    when I open a terminal window on Aspire One and write "java -jar BridgeCharts.jar" then I get following message:

    Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-win32-3448 or swt-win32 in swt.library.path, java.library.path or the jar file
    at org.eclipse.swt.internal.Library.loadLibrary(Unkno wn Source)
    at org.eclipse.swt.internal.Library.loadLibrary(Unkno wn Source)
    at org.eclipse.swt.internal.C.<clinit>(Unknown Source)
    at org.eclipse.swt.widgets.Display.<clinit>(Unknown Source)
    at BridgeCharts.main(BridgeCharts.java:42)

    Line 42 in BridgeCharts.main is "String test = "no-test";"

    It looks like some libraries are missing concerning Windows ... but I can easily be wrong.

    Any suggestion to what I shall do next?
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Now you're getting beyond me, especially when SWT appears included in the mix (is this an SWT GUI application or something simplier?), but perhaps you need to have with your jar the SWT native libraries for whatever platform you're exporting to -- just a guess. Myself I use Swing which is pretty much able to be ported to any platform.

  5. #5
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default

    Yes it is a SWT GUI application and I think you are right in focusing on SWT. Out there I find this one

    <here should be a link (required post count has grown from 10 to 20 posts)>

    which suggest there is a problem with swt.jar for the actual os architecture or a problem with write access.

    I will return with a solution if I find one :)

    So I will not close this thread ... someone may come up with something :D
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    thanks for the info. If you post the link as plain text, not a link, and without the www , the forum software should allow it. Best of luck!

  7. #7
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default

    Ok! The link is "forum.vuze.com/thread.jspa?threadID=84400&tstart=0"
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

  8. #8
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Thanks. Here's the link: Vuze Forums: Vuze 4.2x cannot use swt 3.5 under ...

    Also have a look at this Wikipedia article here: SWT: Platform Support. This appears to be a common issue with SWT.
    Last edited by Fubarable; 08-16-2009 at 02:42 PM.

  9. #9
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default

    Thanks, Fubarable, an excellent Wikipedia link. It points out that SWT is platform dependent.

    SWT seems to be a bad choice when you know your program will be used on several platforms. On the other hand, acording to link:

    .jguru.com/faq/view.jsp?EID=507891]jGuru: What is the difference between AWT and SWT?

    AWT also has that sort of problems.

    So I have to install eclipse on my Aspire One ... a challenge for someone who has just bought "Linux for Dummies".
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

  10. #10
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    For the benefit of others, the link you refer to is this one: jGuru: What is the difference between AWT and SWT.

    For your benefit, please understand that this article is 8 years old which is a long time when it comes to programming language libraries as AWT use has fallen off a great deal and has mostly been supplanted by Swing. So the real question for you should be SWT vs. Swing.

    Here are some of the results of my search on SWT vs. SWing:
    Developer.com
    Wikipedia
    Sitepoint.com blog

  11. #11
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default

    Again, Thank you, you have been VERY helpfull!
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

  12. #12
    pellebye is offline Member
    Join Date
    Apr 2009
    Posts
    54
    Rep Power
    0

    Default

    Hi everyone.

    Yes, indeed, SWT is very platform dependent.

    So, for other newbies, here is what I did:

    1. After installing java I downloaded eclipse Ganymede to my /home/usr directory.

    2. I unpacked the downloaded file with "tar -zxvf filename.tar.gz" that made a new directory named "eclipse" with the unpacked files.

    3. I went to the eclipse directory ("cd eclipse"), checked that the eclipse file was runnable ("ls -l eclipse") and run the eclipse program ("./eclipse").

    4. Now eclipse was running and I copied my java files from my Vista system to linux by importing them to a new project in eclipse. There was a lot of errors because SWT was missing.

    5. So I downloaded and imported SWT for Linux in the new project (took me a while to realize that SWT should be imported to the project ... not to eclipse).

    6. Now I can run the same java program on Vista and on Linux ... amazing! Well, I still have som problems but they relate to java/Linux and have nothing to do with SWT.

    In the whole process I got a lot of wonderfull help from many places out there.
    -
    Life is not the worst thing we have ... in a few minutes my coffee is ready.

Similar Threads

  1. Where to get jdk1.5 for linux
    By ran_sushmi in forum Advanced Java
    Replies: 1
    Last Post: 07-21-2009, 12:55 PM
  2. Where to get jdk1.5 for linux
    By ran_sushmi in forum Advanced Java
    Replies: 0
    Last Post: 07-20-2009, 02:46 PM
  3. Replies: 6
    Last Post: 04-08-2009, 04:05 AM
  4. new member need help with linux
    By praveena in forum New To Java
    Replies: 0
    Last Post: 01-22-2008, 10:22 AM
  5. eclipse in linux
    By bbq in forum Eclipse
    Replies: 1
    Last Post: 07-04-2007, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •