English 中文(简体)
• 如何为我的节目制作一份工作手册?
原标题:How to generate a working jar file for my program?

我很新,可以 j,事实上这是我的第一个方案。 我似乎在为我的java方案制作一个jar档案方面遇到问题。 这是一个非常基本的方案,它只是从一个网站收集数据,然后以电子格式展示。 该方案取决于Jsoup和HtmlCleaner。 The gui was made with JFormDesigner.

回到问题,当我用ec子管理方案时,一切都完全有效。 没有任何问题。 然而,当我把它作为出口支柱(或与JarMaking公司做的jar)时,德国马克公司甚至显示了这一点。 奇怪的是,当我用<代码>.bat文档管理时,德国马克显示器具显示器,但该节目没有做什么。

I am really stuck, I am not sure what to try next. Any help will be greatly appreciated.

//package com.stackoverflow.q2835505;


import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import java.awt.*;

import javax.swing.*;

import com.sun.xml.internal.ws.util.StringUtils;

public class TestDumper extends JFrame {
public static String test = "+";
public static String test1 = "-";
public static String itemID;
public static String stab;
public static String slash;
public static String crush;
public static String magic;
public static String range;
public static String stabDef;
public static String slashDef;
public static String crushDef;
public static String magicDef;
public static String rangeDef;
public static String Str;
public static String Prayer;
public static String lowAlch;
public static String highAlch;
public static String Name;
public boolean guiWait = false;
public static boolean printed = true;



    public static void main(String[] args) throws Exception {
        statGrabber g = new statGrabber();
        g.setDefaultCloseOperation(EXIT_ON_CLOSE);
        g.setVisible(true);

        for ( ; ; ) {
        while(g.test){
        String url = g.textField2.getText();
        Document document = Jsoup.connect(url).get();
        stab = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(2).text();
        slash = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(3).text();
        crush = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(4).text();
        magic = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(5).text();
        range = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(6).text();
        stabDef = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(7).text();
        slashDef = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(8).text();
        crushDef = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(9).text();
        magicDef = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(10).text();
        rangeDef = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(11).text();
        Str = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(16).text();
        Prayer = document.select("table.wikitable.smallpadding tbody tr td").tagName("TD").eq(17).text();
        Name = document.select("table.wikitable.infobox caption b").text();
        highAlch = document.select("table.wikitable.infobox tbody tr td").tagName("TD").eq(8).text();
        lowAlch =  document.select("table.wikitable.infobox tbody tr td").tagName("TD").eq(9).text();
        g.sweet = true;
       // String shopPrice = document.select("table.wikitable.infobox tbody tr td").tagName("TD").eq(11).text();


       if(stab.startsWith(test)){
           stab = stab.substring(1);
       }
       if(slash.startsWith(test)){
           slash = slash.substring(1);
       }
       if(crush.startsWith(test)){
           crush = crush.substring(1);
       }
       if(magic.startsWith(test)){
           magic.trim();
           magic = magic.substring(1);
       }
       if(range.startsWith(test)){
           range.trim();
           range = range.substring(1);
       }
       if(stabDef.startsWith(test)){
           stabDef = stabDef.substring(1);
       }
       if(slashDef.startsWith(test)){
           slashDef = slashDef.substring(1);
       }
       if(crushDef.startsWith(test)){
           crushDef = crushDef.substring(1);
       }
       if(magicDef.startsWith(test)){
           magicDef.trim();
           magicDef = magicDef.substring(1);
       }
       if(rangeDef.startsWith(test)){
           rangeDef.trim();
           rangeDef = rangeDef.substring(1);
       }
       if(Str.startsWith(test)){
           Str.trim();
           Str = Str.substring(1);
       }
       if(Prayer.startsWith(test)){
           Prayer.trim();
           Prayer = Prayer.substring(1);
       }


       if(highAlch.equalsIgnoreCase("Cannot be alchemised")){
           highAlch = "0";
           lowAlch = "0";
       }
       else{
           highAlch = highAlch.replace(",", "");
           highAlch = highAlch.replace(" ", "");
           highAlch = highAlch.replace("c", "");
           highAlch = highAlch.replace("o", "");
           highAlch = highAlch.replace("i", "");
           highAlch = highAlch.replace("n", "");
           highAlch = highAlch.replace("s", "");

           lowAlch = lowAlch.replace(",", "");
           lowAlch = lowAlch.replace(" ", "");
           lowAlch = lowAlch.replace("c", "");
           lowAlch = lowAlch.replace("o", "");
           lowAlch = lowAlch.replace("i", "");
           lowAlch = lowAlch.replace("n", "");
           lowAlch = lowAlch.replace("s", "");
       }

       while(printed){
        System.out.print("item = "+ itemID+"	");
        System.out.print(Name.replace(" ", "_")+"	");
        System.out.print(Name.replace(" ", "_")+"	");
        System.out.print(highAlch+"	");
        System.out.print(lowAlch+"	");
        System.out.print("0	");
        System.out.print(stab+"	");
        System.out.print(slash+"	");
        System.out.print(crush+"	");
        System.out.print(magic+"	");
        System.out.print(range+"	");
        System.out.print(stabDef+"	");
        System.out.print(slashDef+"	");
        System.out.print(crushDef+"	");
        System.out.print(magicDef+"	");
        System.out.print(rangeDef+"	");
        System.out.print(Str+"	");
        System.out.print(Prayer+"
");
        System.out.print("Connected!
");
        printed = false;
       }
        }
    }
    }
    }  
问题回答

在香料中,你可以正确地点击项目名称。

  • select export
  • in Java categories select Runable JAR file
  • select the configuration of main class (if it not found, you should run your app before)
  • set export destination
  • select copy require libs in to sub-folder
  • finish

当你出口jar时,你可以把依赖性jar作为圣经的甲型切入物。 mf 档案。 http://docs.oracle.com/javase/tutorial/dplo/jar/downman.html“rel=“nofollow”http://docs.oracle.com/javase/tutorial/dplo/jar/downman.html。 一旦你打算这样做,就会确保各自的受抚养人能够上班。

您可以使用Eclipse IDE生成书状。 你们还可以把图像或媒体档案等资源档案添加到.jar。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签