Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to run a program created in Netbeans outside the IDE?

 
Miguel Enriquez
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends.

I created a small app (login/Password) app

i used swing and JSF.

choose my JFrame, right click and run.

run perfectly the Project, ask me user and password (the user and password was validated versus a mysql table).

No problem in general.

but my question is how to run from a cmd window? i want translate my program to other pc.....

i try:

C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\build\classes>dir *.class /s
/c
Volume in drive C is Windows8_OS
Volume Serial Number is 647E-5821

Directory of C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\build\classes\
codigo

01/07/2013 12:42 a. m. 1,839 validaacceso.class
1 File(s) 1,839 bytes

Directory of C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\build\classes\
jeeprueba

01/07/2013 12:42 a. m. 390 JeePrueba.class
1 File(s) 390 bytes

Directory of C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\build\classes\
vistas

01/07/2013 12:42 a. m. 698 frmLogin$1.class
01/07/2013 12:42 a. m. 726 frmLogin$2.class
01/07/2013 12:42 a. m. 726 frmLogin$3.class
01/07/2013 12:42 a. m. 526 frmLogin$4.class
01/07/2013 12:42 a. m. 7,359 frmLogin.class
01/07/2013 12:42 a. m. 719 frmMenu$1.class
01/07/2013 12:42 a. m. 522 frmMenu$2.class
01/07/2013 12:42 a. m. 5,028 frmMenu.class
8 File(s) 16,304 bytes

Total Files Listed:
10 File(s) 18,533 bytes
0 Dir(s) 744,720,257,024 bytes free

C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\build\classes>

C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\build\classes>java -cp C:\Us
ers\Angus\Documents\NetBeansProjects\jeePrueba\build\classes com.example.JeePrue
ba
Error: Could not find or load main class com.example.JeePrueba

C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\build\classes>

C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\dist>java -jar jeePrueba.jar


*****No errors but not run the app

any advice?


a friend recommend me create a servlet, any url for learn? thanks
thanks
 
Miguel Enriquez
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now! i run the program:

C:\Users\Angus\Documents\NetBeansProjects\jeePrueba\build\classes>java -cp .;C:\
Users\Angus\Documents\NetBeansProjects\mysql-connector-java-5.0.6-bin.jar vistas
.frmLogin


thanks
 
Joe Areeda
Ranch Hand
Posts: 331
2
Java Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually NetBeans will do all that for you.

Right click on the project, select clean and build

The output window will contain the instructions for running it something like

java -jar "<path to project>/dist/<name of project>.jar"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic