-1

I am working for a project in netbeans. When i'll finish my project how can i execute my application (out of Netbeans)? I'm working for a little and simple guide of a game.

Tarik
  • 10,810
  • 2
  • 26
  • 40

2 Answers2

0

Simply create a .bat file with the following lines in it:

@ECHO OFF
set CLASSPATH=.
set CLASSPATH=%CLASSPATH%;path/to/needed/jars/my.jar

%JAVA_HOME%\bin\java -Xms128m -Xmx384m -Xnoclassgc ro.my.class.MyClass

Taken from this link : StackOverflow Link

Community
  • 1
  • 1
ak0053792
  • 523
  • 1
  • 5
  • 18
  • But if i open it with netbeans the program will open netbeans too? – user3721668 Jun 22 '14 at 16:50
  • Exactly. But what is the programming language which is being used for your project can you pls elaborate ? – ak0053792 Jun 22 '14 at 16:52
  • im using java, do u want to see the program? – user3721668 Jun 22 '14 at 16:54
  • Ohk you want to run your code via NetBeans, try below: To run the program: Choose Run > Run Project. – ak0053792 Jun 22 '14 at 16:56
  • He just wants to double click on the his program and run it – Luis Alves Jun 22 '14 at 16:57
  • i want to run it out of netbens like a normal program – user3721668 Jun 22 '14 at 17:00
  • Ok, in that 1 suggestion is to create a batch file which indirectly runs a command like 1: Goes to the project directory 2: java – ak0053792 Jun 22 '14 at 17:03
  • He doesn't know how to use the terminal :( (please consider to start using linux, it's much more easy to work with java, c ...) – Luis Alves Jun 22 '14 at 17:03
  • Try to right click on the file you want to run, and the choose run with (or something similar) and pick java. Does it works? – Luis Alves Jun 22 '14 at 17:05
  • it say to me i have to install miscrosoft visual studio 2005 :S – user3721668 Jun 22 '14 at 17:06
  • lol. Do this them, go to the folder where you have the file you want to execute. Hold shift, right click the folder you want it opened on, and click "open command window here". Then type java and press enter. (sorry but i don't use windows for 2 years, but I think this may work) – Luis Alves Jun 22 '14 at 17:08
  • @user3721668 I have update my answer. Try doing that. It will serve your puprose hopefully. – ak0053792 Jun 22 '14 at 17:08
  • BTW, learn try to learn a bit about how to use the command prompt where you have a tutorial for windows:http://www.cs.princeton.edu/courses/archive/spr05/cos126/cmd-prompt.html – Luis Alves Jun 22 '14 at 17:11
  • ok i'll try to do it, sry another time but i've only 15 years old, i never study IT at school...only next year, ty for ur time! – user3721668 Jun 22 '14 at 17:14
0

To launch your java application use java.exe from the command line. See How do I run a .jar executable java file from outside NetBeans IDE?

Community
  • 1
  • 1
Tarik
  • 10,810
  • 2
  • 26
  • 40