开发者

Compile in command line java desktop app written in NetBeans with netbeans gui editor?

I made my project in Netbeans but my professor 开发者_运维问答said it must be able to compile it with command line. So tried everything i still get errors like : org.jdesktop.application package does not exist?

Please help me how to feed the line in the command prompt.


You need app-framework.jar in your classpath, which is there in classpath if you run it from NB.


Use -classpath key of javac to include the appropriate jar.

C:\...\ATM\ATM\src\atm>javac
ATMApp.java ATMView.java CheckIDandPIN.java AccountDetailsServices.java -cp appf
ramework-1.03.jar

This works if the appframework.jar is located in one folder with ATMApp.java

C:\...\ATM\ATM\src>java -classpath .;appframework-1.03.jar atm.ATMApp

This launches your application if you copy the jar to src folder.


sounds like a misunderstanding. By default, Netbeans uses ant to build projects. Ant is a CLI build tool. So, most any Netbeans project will easily compile and build as a JAR from the CLI. Simply run ant -p build.xml from in the project directory. You should see options to build. As far as I can recall, ant jar will build and distribute most any SE project out of the box.

That's building from the CLI.

Probably the instructions were (back in 2010) to use javac directly.

As Jigar said, you have a classpath problem. Your classpath problem is unrelated to building the JAR from the Netbeans GUI or from the CLI.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜