Build your professional network on facebook via our app Go to app
 
<< Prev  5 of 11 in Topic  Next >>
Topic : .NET or JAVA
  Rate : 
 
Activity: Question posted: 08 03 2010 15:14:05 +0000, 6 answers, 1020 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, Software Developer, ROBOMAN MICROSYSTEMS  | 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
Leading Recruitment Firm
Viewers also viewed
Yes vs No
 
197 referals 6 arguments, 426 views
A few days back I read a post by Manish Kumar which said we should build what we think should...
 
1691 referals 11 votes, 389 views
Recently we are seeing news like IIM Kolkata MBA graduate got a whopping 1.4 cr package and...
 
1655 referals 48 arguments, 9232 views
more...  
Unanswered Questions (61)
Dear all, I have joined one of the leading company on Aug 2010. Before joining, i had to sign a...
 
0 referals 0 answers, 0 views
IS ACADEMIC PERCENTAGE CRITERIA ALWAYS MANDATORY FOR EXPERIENCED SAP CONSULTANTS. HOW TO OVER...
 
1 referals 0 answers, 0 views
sir this is R.V.Srinivas Research scholar andhra University, i am doing my mphil on retail...
 
1 referals 0 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...