Java Desktop programs written by Swing and Swt in Ubuntu9.04

Source: Internet
Author: User
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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.