如何在ide外部运行java文件

如何在ide外部运行java文件,java,eclipse,Java,Eclipse,所以我有这个程序,我想给其他人使用。问题是这个人没有ide,也不知道如何使用cmd。那我该怎么办?该程序在eclipse中运行良好,但我知道如何让它在eclipse之外工作 import javax.swing.JOptionPane; public class Encrypter { public static void main(String []args){ //varibles String input; String inputt

所以我有这个程序,我想给其他人使用。问题是这个人没有ide,也不知道如何使用cmd。那我该怎么办?该程序在eclipse中运行良好,但我知道如何让它在eclipse之外工作

import javax.swing.JOptionPane;

public class Encrypter {
     public static void main(String []args){
    //varibles
         String input;
         String inputtwo;
         String inputthree;
         String inputfour;
         int x;
         int y;
         int z;
         int n;
         int xtwo; 
         int ytwo;
         int ztwo;
         int ntwo;

    //takes input 
    input =
            JOptionPane.showInputDialog( "What is your first number?" );
    inputtwo =
            JOptionPane.showInputDialog( "What is your second number?" );
    inputthree =
            JOptionPane.showInputDialog( "What is your third number?" );
    inputfour  =
            JOptionPane.showInputDialog( "What is your fourth number?" );
    // changes the to ints
    x=Integer.parseInt(input);
    y=Integer.parseInt(inputtwo);
    z=Integer.parseInt(inputthree);
    n=Integer.parseInt(inputfour);

    //maths and stuff
    xtwo= (x +7)%10;
    ytwo= (y +7)%10;
    ztwo= (z +7)%10;
    ntwo= (n +7)%10;


    //shows it
            JOptionPane.showMessageDialog(null,  xtwo + "" + ytwo + "" + ztwo  + "" + ntwo);
    System.exit( 0 );
}

}

右键单击项目->选择
Export
,然后选择
Runnable Jar
。只需在下面的窗口中给出要导出的路径


快速搜索会让您知道

当您尝试用谷歌搜索这个问题时发生了什么?提示:尝试右键单击您的eclipse项目->导出->java->runnable Jar,例如,您可以这样做。@Kon我还不知道如何正确地表达我的搜索。@Hulk谢谢您,这非常有效。