This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Shortcut for Project Execution Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Shortcut for Project Execution" Watch "Shortcut for Project Execution" New topic
Author

Shortcut for Project Execution

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
My project is complete now . How I execute my project is :

1] I have put my project into a folder ( studentpro ) & that folder is inside bin folder of jdk .

2] for execution , I go in that folder ( studentpro ) from command prompt & then I set path like this :

set path=.;c:/program files/java/jdk1.5.0/bin

otherwise 'javac' command doesn't work .

3] after this I take classes12.zip file into my class path like this :

set classpath=.;c:/program files/java/jdk1.5.0/bin/classes12.zip
( I have put classes12.zip into my bin folder )

4] then compile & execute .


I know there will be any shortcut for this or I am doing unnecessary things . What I want is there should be one batch file ( .bat ) on desktop & project should start after clicking on that .

please help me ...

lots of thanks .
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Set required libraries in your system classpath, atleast jdk should be at your systems classpath.
Better use ant script for compiling and running the app.

cheers.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Didn't get ..
Please explain it in detail ..

thanks .
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Rathi,
i am talking about apache ANT tool.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
I am new to this ...
please can you explain it in details .
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

Rathi,
I think ant is overkill for this. When you do larger projects, it is something to look into. (When the time comes we have an Ant forum below.)

Creating a batch file is a good idea. Create a file with the extension .bat. Open the file in notepad and type in the commands you put in your initial post. Then you can double click and run the batch file.

Adeel raises a good point that you will likely be using the same path/classpath settings repeatedly. You can set these under the control panel in Windows and the login script in UNIX/Linux.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Hi ,
I tried that only but is is not working .
here is my batch file ( start.bat )


cd program files/java/jdk1.5.0/bin/ankurp

set path=.;c:/program files/java/jdk1.5.0

set classpath=.;c:/program files/java/jdk1.5.0/bin/classes12.zip

javac my/Start.java

java my.Strat


please help ...
thanks .
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Sorry ...

It is working now ...

I used slash ( / ) instead of backslash ( \ ) in first line .

Thanks .
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

Rathi,
Glad to hear you got it working.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Hi ,

Now my that project is completed . But in new project I have to use Ant .
Can any body explain me this in short .
What I know is :
Ant is a open source project that help us to build & compile java application .

please help ...
thanks .
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


What I know is :
Ant is a open source project that help us to build & compile java application

Well, almost. A better definition is that is it a tool to help build and deploy applications (whether they contain code written in Java or not).

I think you need to read the manual. Any difficulties, post them in the Ant forum and I'm sure someone will help.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Shortcut for Project Execution
 
Similar Threads
my first java program
Trouble with Jenny
creating .class file in Tomcat
Class Path
Basic help