• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compile and deploy from DOS prompt

Ed Mirsky
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I�m a novice and I need help.

To make the notation simpler (I hope),
Let D� mean Directory
Let DD� mean subdirectory

I was as able to run my application from the DOS command prompt when it had the following structure:

D� myJ2
DinnerMenu.class (has main(String args[] and uses SpringUtilities)
Calculator.class ( a dialog which uses SpringUtilities)
SquareRootDialog.class (a dialog which uses SpringUtilities)
DD�pac (a subdirectory with many directories)

I decided to put Calculator.class and SquareRootDialog.class in a directory called dlg, and I put SpringUtilities.class into a directory called utl. The new structure of the application is:

D� myJ2
DD� utl
DD� dlg
DD� pac
Classes used by Calculator and SquareRootDialog

I import SpringUtilities into DinnerMenu, Calculator, and SquareRootDialog with:
import utl.SpringUtilities;

import SpringUtilities;

( Problem 1)
I need to recompile Calulator.class and SquareRootDialog.class before compiling DinnerMenu.class, but I can�t figure out how to do that. (I�ve been trying for a week.)

I�ve tried the following without success to compile Calculator:

C:\myJ2\dlg>path= C:\Program Files\Java\jdk1.5.0_03\bin
C:\myJ2\dlg>set CLASSPATH=C:\myJ2\utl;C:\myJ2\pac;C:\myJ2\dlg
C:\myJ2\dlg> javac -classpath %CLASSPATH% Calculator.java

SAMPLE ERROR MESSAGE ---------------------------------------
Calculator.java:17: package pac.libr.mat does not exist
import pac.libr.mat.MathLibrary;
Calculator.java:18: package pac.libr.sta does not exist
import pac.libr.sta.StatLibrary;
Calculator.java:19: package utl does not exist
import utl.SpringUtilities;

------------------------------------------- END ERROR MESSAGE

(Problem 2)
I want to create an executable JAR file. Will this do the job?
C:\>myJ2jar cvf DinnerMenu.jar DinnerMenu*.class dlg

(Problem 3)
Ultimately, I want to run the application. Will this do the job?
C:\myJ2>set CLASSPATH=C:\myJ2\myJar.jar
C:\myJ2>java -classpath "./DinnerMenu.jar" DinnerMenu

(Problem 4)
One last question. I think the jdk1.5 has SpringUtilities. Can I eliminate SpringUtilities.class from my application and import it into DinnerMenu and Calculator with something like: import SpringUtilities;

Thanks in advance for you help,

Bear Bibeault
Author and ninkuma
Posts: 65530
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an Ant or Maven question as far as I can tell, so moved to the Java in General (beginner) forum.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!