0

So I have this program that I would like to give to someone else to use. The problem is this person does not have an ide, nor do they do know how to use the cmd. So what do I do? The program runs fine in eclipse, but I have know idea how to get it to work outside of 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 );
}

}

1 Answers1

0

Right click on the project -> Select Export then Runnable Jar. Just give the path to export in the following window.

Export Runnable Jar

A quick search would have got you the results from SO

Community
  • 1
  • 1
Slartibartfast
  • 1,592
  • 4
  • 22
  • 33