找到你要的答案

Q:How to export only the Client to a jar from a RMI - Eclipse

Q:如何出口只有客户端JAR从RMI日食

I have created for a first time a programm in Java SWING including RMI Connection with PORT (Server - Client) in Eclipse.

Now I want to export only the Client (to a jar File if its possible ) and test it (via install it) to another computer so I could see if it works and how it works.

The Structure of my project in Eclipse is like :

From there I want only the Client to export and install it to another PC and start the Programm with the LoginForm.java. The .jar export files that have tryed and created they dont do nothing at all. Also dont know if I have to do something specific with the Build Path or the folders (like Image folder) that I have extra create.

我有一个第一次在java swing包括RMI连接端口(服务器-客户端程序创建)在Eclipse。

现在我只想导出客户端(如果有可能的话,到JAR文件),然后测试它(通过安装它)到另一台计算机上,这样我就可以看看它是否工作,以及它是如何工作的。

Eclipse中我的项目结构如下:

我想只有客户出口并安装到另一台PC机和启动程序的loginform.java。的。罐出口文件,试着创造了他们不做什么都没有。也不知道,如果我必须做一些具体的建设路径或文件夹(如图像文件夹),我有额外的创建。

answer1: 回答1:

JavaMunich:

Hava try it and nowthing happens when I double cliked it


You can't just double click a .jar file, you can execute the program by using the following command.

java -jar YOURJAR.jar

You could make a .bat file with the command in it to make it easier for future executions.

  1. Open notepad.
  2. write :- java -jar YOURJAR.jar.
  3. Save it with the extension .bat.
  4. copy it to the directory which has the .jar file.
  5. double click it to run your jar file.

JavaMunich:

有尝试,nowthing发生时,我的双cliked它


你不能只双击一个jar文件,你可以使用下面的命令来执行程序。

java -jar YOURJAR.jar

你可以用它的命令制作一个蝙蝠文件,以便于将来执行。

  1. Open notepad.
  2. write :- java -jar YOURJAR.jar.
  3. Save it with the extension .bat.
  4. copy it to the directory which has the .jar file.
  5. double click it to run your jar file.
java  jar  export  rmi