• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Compile and deploy from DOS prompt

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
SpringUtilities.class
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
DinnerMenu.class
DD� utl
SpringUtilities.class
DD� dlg
Calculator.class
SquareRootDialog.class
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:>cd\myJ2\dlg
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?
CREATE THE JAR FILE
C:\myJ2\dlg>cd\myJ2
C:\>myJ2jar cvf DinnerMenu.jar DinnerMenu*.class dlg

(Problem 3)
Ultimately, I want to run the application. Will this do the job?
RUN THE APPLICATION
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,

Ed
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic