Results 1 to 3 of 3
  1. #1
    Arnold is offline Member
    Join Date
    Oct 2009
    Location
    Rotterdam
    Posts
    52
    Rep Power
    0

    Post Compiler deadlock

    Recently I started working with packages. Now I have a problem compiling all classes at once.
    Lets say I have the following folder structure:
    Java Code:
    C:
    |	Folder
    |	|	mypackage
    |	|	|	subpackage
    |	|	|	|	B.java
    |	|	|	A.java
    And A.java looks like this:
    PHP Code:
    package mypackage;
    import mypackage.subpackage.B;
    public class A {
    	public final static String _do = "Do something";
    	public static void main(String[] args) {
    		B.doSomething();
    	}
    }
    And B.java looks like this:
    PHP Code:
    package mypackage.subpackage;
    import mypackage.A;
    public class B {
    	public static void doSomething() {
    		System.out.println(A._do);
    	}
    }
    The 2 classes need to access each others resources, but can't, because the compile wants to see the other compiled first.
    Normally if the 2 classes were in the same folder I could do:
    javac *.java
    Is there any way to tell the compiler to compile all .java files in the subfolders too?

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,536
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by Arnold View Post
    Is there any way to tell the compiler to compile all .java files in the subfolders too?
    Does this help?

    Java Code:
    javac *.java subpackage/*.java
    kind regards,

    Jos

  3. #3
    Arnold is offline Member
    Join Date
    Oct 2009
    Location
    Rotterdam
    Posts
    52
    Rep Power
    0

    Smile

    Quote Originally Posted by JosAH View Post
    Does this help?

    Java Code:
    javac *.java subpackage/*.java
    kind regards,

    Jos
    Yes it works. And it runs too. Thanx

Similar Threads

  1. How to avoid the Deadlock in the below program
    By murali1253 in forum New To Java
    Replies: 3
    Last Post: 04-16-2010, 05:46 PM
  2. [SOLVED] Deadlock ?
    By jon80 in forum New To Java
    Replies: 1
    Last Post: 06-14-2009, 07:54 PM
  3. Thread Deadlock
    By ajeeb in forum New To Java
    Replies: 2
    Last Post: 01-16-2009, 02:49 AM
  4. How to create a simple deadlock
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 06:36 PM
  5. Deadlock detection tools documentation
    By goldhouse in forum Threads and Synchronization
    Replies: 0
    Last Post: 07-18-2007, 05:18 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •