Build your professional network on facebook via our app Go to app
 
<< Prev  5 of 11 in Topic  Next >>
Topic : .NET or JAVA
  Rate : 
 
Asked by : Keyur Ashra, MCA student, AESICS
Activity: Question posted: 08 03 2010 15:14:05 +0000, 6 answers, 1881 views, last activity 03 20 2012 06:28:00 +0000
 
 Refer 200
Share
 
 
 
 

I want to create 50 packages and for that i require 50folders and i don't want to create them manually, but i know that it is also possible at run-time but not how to do that from the command prompt.If any body have idea please help me.

 
 Top Answer :
Rating : +1 

>javac -d <src> <java files>

 

i.e.

package p1.p2;

class A {  }

 

* create a folder say src in current directory where you want to place classes mapped with package.

* run the following command.

 

>java -d src *.java

 

It will create folder hierarchy corresponding to package defined in source code.

 

src

|_p1

   |_p2

      |_A.class

 

Try it. I hope problem will be resolved.

regards

Angeline

 

 
i.e.
package p1.p2;
class A {  }
 
* create a folder say src in current directory where you want to place classes mapped with package.
* run the following command.
 
>java -d src *.java
 
It will create folder hierarchy corresponding to package defined in source code.
 
src
|_p1
   |_p2
      |_A.class
 
Try it. I hope prob



[ Delete ]
[ Edit ]
Report Abuse
by   Angeline , B.Tech/B.E. student, mullana  | 08 07 2010 06:58:46 +0000
  Answered by     Nitin Mehra, Writer, Thinker, Technology Seekar  | 03 20 2012 06:27:59 +0000
[ Delete ]
[ Edit ]
Not Rated

Mr. Devendra is right. you can invoke the dos command or script from the program itself to make the package directory.

  Answered by     harsh , n/a, n/a  | 03 17 2012 13:34:28 +0000
[ Delete ]
[ Edit ]
Not Rated

there is a editing in your answer ::

wrong -->      java -d src *.java

must use --> javac -d src*.java

thanks

 

  Answered by     harsh , n/a, n/a  | 03 17 2012 13:29:40 +0000
[ Delete ]
[ Edit ]
Not Rated

THANKS Angel---------------------

 

  Answered by     Anubhav Jain, B.Tech/B.E. student, BMAS Engineering College ,Agra  | 08 05 2010 11:31:41 +0000
[ Delete ]
[ Edit ]
Rating : +1 

normally you would use the mkdir command on the command prompt to create a directory.

  Answered by     Devendra Dave, Team Leader -(Technical), Wipro  | 08 05 2010 03:26:25 +0000
[ Delete ]
[ Edit ]
Rating : +1 

Writing the batch scripts can help here. You can even invoke this batch scripts from Java program.

 
Leading recruitment Firm
  • Create a confidential Career Profile and Resume/C.V. online
  • Get advice for planning their career and for marketing of experience and skills
  • Maximize awareness of and access to the best career opportunities
Viewers also viewed
A few days back I read a post by Manish Kumar which said we should build what we think should...
 
1691 referals 12 votes, 848 views
Hi All, How is the idea of moving from .net Development to Java development sound to you? One of...
 
181 referals 22 arguments, 933 views
Yes - Big companies should start investment for growth vs No - Need to stick with campus...
 
1990 referals 12 arguments, 321 views
more...  
Unanswered Questions (27)
Can you please tell me about the registration details regarding to computer institute.. or other...
 
2 referals 0 answers, 0 views
 
1 referals 0 answers, 0 views
 
0 referals 1 answers, 0 views
More From Author
no its not advantageous to fresher. because its a difficult task to get a job in today's era. And there will be always negotiation starts from company side because they know that he/she is fresher so they can get the benefit and always the fresher...
Yes, i am also a student and if get the placement and if the company says that you are on 6month training and we'll not give you any salary or stipend then also i do that because in today if you go to any multinational company for training or any small...
How to make connection with SQL or ORACLE in JAVA using the NETBEANS IDE 6.8?
more...