This article takes Ubuntu9.04 as an example of the premise: first install jdk with jre (the following link in the article) install (a) casually next. jar program, here I select the YOYOPlayer below is the http://www.linuxidc.com/Linux/2009-08/2
This document takes Ubuntu 9.04 as an example.
Prerequisites: Install jdk with jre first (as described in the following link)
Http://www.linuxidc.com/Linux/2009-08/21115.htm
Swing should be simpler.
(1)
For the next. jar program, here I select
Http://www.linuxidc.com/Linux/2009-08/21115.htm
(2)
(1) method 1 (specify to be opened by jexec of jre ):
Right-click YOYOPlayer. jar-> Properties-> Open with-> add-> Use custom command
-> Browser-> choose to open it by the specified/usr/lib/jvm/jdk-6u14-linux-i586/jre/lib/jexec.
Location)
(2) method 2 (Use sh, that is, bat in windows)
Create a new sh file, for example, YOYOPlayer. sh.
#! /Bin/sh
Java-jar YOYOPlayer. jar
After saving, change the properties of YOYOPlayer. sh.
Right-click YOYOPlayer. sh-> Properties-> Permissions-> hook Allow executing file as program-> close-> double
Click YOYOPlayer. sh-> pop-up dialog box-> Select Run-> Start successful!
Next we will talk about SWT
In windows, you can use a swt. jar file. in Linux, you must have a swt. jar file in Linux.
There are a lot of ways to set environment variables on the Internet, so I still fail to set all my headers!
Finally, I tried the java-jar method and the result was OK. It was so ecstatic! In this way, you can use the sh method.
The program tested here is a self-developed Browser that uses the Browser in SWT. Browser calls IE by default in windows and firefox by default in Ubuntu.
Create a new sh file: JJBrowser2.sh
#! /Bin/sh
Java-jar JJBrowser2.jar
After saving, change the JJBrowser2.sh attributes.
Right-click JJBrowser2.sh-> Properties-> Permissions-> hook Allow executing file as program-> close-> double-click JJBrowser2.sh-> pop-up dialog box-> Select Run-> Start successful!
Use Eclipse in Ubuntu