Java - GENERAR .JAR

 
Vista:
sin imagen de perfil

GENERAR .JAR

Publicado por FRANCISCO (20 intervenciones) el 03/07/2017 22:02:53
HOLA AMIGOS ESTOY HACIENDO UN SISTEMA EN JAVA PERO QUIERO CONSTRUIR EL .JAR

LO QUE HAGO ES SELECCIONAR LA CLASE PRINCIPAL Y LUEGO LE DOY CLICK EN LIMPIAR Y CONTRUIR ESTO ME GENERA EL .JAR PERO A LA HORA DE EJECUTARLO ME DICE ESTO

(no se ha encontrado o cargado la clase principal diseño.inicio )

LES DEJO EL MAIN DE LA CLASE PRINCIPAL (estoy trabajando en windows)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
public static void main(String args[]) {
    /* Set the Nimbus look and feel */
    //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
     * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
     */
    try {
        for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                javax.swing.UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (ClassNotFoundException ex) {
        java.util.logging.Logger.getLogger(inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
        java.util.logging.Logger.getLogger(inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
        java.util.logging.Logger.getLogger(inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
        java.util.logging.Logger.getLogger(inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
    }
    //</editor-fold>
 
    /* Create and display the form */
 
 
    java.awt.EventQueue.invokeLater(new Runnable() {
        public void run() {
            new inicio().setVisible(true);
 
        }
    });
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil
Val: 111
Ha mantenido su posición en Java (en relación al último mes)
Gráfica de Java

GENERAR .JAR

Publicado por Gonzalo (112 intervenciones) el 03/07/2017 23:55:43
te recomiendo usar eclipse, solo vas a file/export, eliges la opcion "runnable JAR file, eliges la funcion main del proyecto y es todo.

ahora para correrlo debes usar el comoando CMD y en el prompt escribes

javac clase.con.main.java

o mencionas el .jar y es todo.

java -jar archivo.jar

recuerda correr el comando en el mismo directorio donde esta el .java o el .jar o mencionar el path completo hasta el .jar o .java.

y si tienes compilador entonces puedes crear el ejecutable y es mucho mas facil.

suerte.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

GENERAR .JAR

Publicado por FRANCISCO (20 intervenciones) el 04/07/2017 00:08:51
muchas gracias lo intentare aver que pasa
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar