-
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.
-
Your jar should already be runnable on linux, vista, etc,... unless it was written with OS-specific code.
-
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?
-
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.
-
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
-
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!
-
Ok! The link is "forum.vuze.com/thread.jspa?threadID=84400&tstart=0"
-
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.
-
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".
-
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
-
Again, Thank you, you have been VERY helpfull!
-
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.