This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to run a program created in Netbeans outside the IDE? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to run a program created in Netbeans outside the IDE?" Watch "How to run a program created in Netbeans outside the IDE?" New topic
Author

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

Miguel Enriquez
Ranch Hand

Joined: Mar 13, 2004
Posts: 94
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

Joined: Mar 13, 2004
Posts: 94
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

Joined: Apr 15, 2011
Posts: 307
    
    2

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"


It's not what your program can do, it's what your users do with the program.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to run a program created in Netbeans outside the IDE?
 
Similar Threads
Could not compile JTidy (jtidy-04aug2000r7-src) with JDK1.6
working with two source files under the same package
Use different JDK versions
to understand which *.MF to use