0

Please see the following webpage: https://netbeans.org/features/ide//build-tools.html. It says: "You can therefore build and run your project outside the IDE exactly as it is built and run inside the IDE.".

I have spent hours trying to figure out how to see this Ant Script. I have found suggestions such as setting: Toola\Options\Ant\Verbosity Level to Debug etc, but I see nothing. How do I see the Ant script generated by Netbeans?

I am trying to see what Netbeans generates when I run the app, so that I can try to run the app externally to Netbeans. It is a J2EE app.

w0051977
  • 15,099
  • 32
  • 152
  • 329

2 Answers2

0

Look for build.xml But J2EE apps must be run inside a webserver such as Tomcat. You can't run them from the command prompt.

Peter Quiring
  • 1,648
  • 1
  • 16
  • 21
  • How do you run an Enterprise Application Client. This is what I am trying to do: http://stackoverflow.com/questions/39793208/run-enterprise-application-client-outside-netbeans – w0051977 Oct 04 '16 at 19:54
  • Usually a .WAR file is generated which you upload to the webserver. Download and install http://tomcat.apache.org/ It will take a while to figure it out. You need to run it and bring up the manager webpage (http://localhost:8080/manager/html) where you can upload your WAR files. Then the J2EE app will be available on the website (http://localhost:8080/myapp) – Peter Quiring Oct 04 '16 at 19:59
  • But this is an application client - not a web app. How do I run an enterprise app client externally to netbeans? – w0051977 Oct 04 '16 at 20:02
  • 1) Tomcat is a web container - it cannot run full Java EE profile. 2) It is possible - just a matter to find how (I'm not sure yet...) – Jonatan Kaźmierczak Oct 04 '16 at 20:47
0

You can follow the Java EE tutorial regarding that topic: http://docs.oracle.com/javaee/6/tutorial/doc/gkhpu.html#gkhol

In case you would decide to use Maven, then the newer version can be more applicable: https://docs.oracle.com/javaee/7/tutorial/usingexamples.htm#GFIUD

Jonatan Kaźmierczak
  • 1,821
  • 2
  • 15
  • 9
  • Thanks, but could you explain how this answers my question? I am trying to run an application client (enterprise application client) outside netbeans. I cannot believe how difficult it is to find any information whatsoever on the subject. Every single example shows how to run in netbeans only. – w0051977 Oct 04 '16 at 21:08
  • Those documents describe how to run the app with ant and maven outside NetBeans - just look there. Hmmmm... now you say that's a client? Before you've said it's a Java EE app... – Jonatan Kaźmierczak Oct 04 '16 at 21:12
  • It is a java application client on pc A that uses glassfish enterprise beans on server B. The application works in netbeans. I am trying to figure out how to use it outside netbeans. Does that make sense? – w0051977 Oct 04 '16 at 21:19
  • See this as an example: https://netbeans.org/kb/docs/javaee/entappclient.html. Main.java is an application client rather than a web client that uses ejbs. – w0051977 Oct 04 '16 at 21:25
  • If I remember correctly, `ant run` does the job. Did you try that? BTW, each time you run the app from NetBeans, you can see the (ant) command used in the Output window. – Jonatan Kaźmierczak Oct 04 '16 at 21:27
  • Ant run app.jar. Is that what you mean? I cant see it being that simple! I think appclient.bat and gf-client.jar play a part somewhere. – w0051977 Oct 04 '16 at 21:31
  • No, just `ant run`. Please check the Output window in Netbeans for the exact command. – Jonatan Kaźmierczak Oct 04 '16 at 21:32
  • I guess the command has to be run in the same directory as build.xml? Where is build.xml? I am a .net developer trying to get up to speed with java in my spare time. Thanks again. – w0051977 Oct 04 '16 at 21:34
  • Yes, in the same dir - please search for it inside your project structure. `find . -name build.xml` on Linux. – Jonatan Kaźmierczak Oct 04 '16 at 21:39
  • Thanks. I will try this tomorrow and then report back marking the answer if necessary. Is it really that simple? Ant run build.xml ? Would it work on a pc without glassfish ie using remote glassfish with remote interface? – w0051977 Oct 04 '16 at 21:43