Results 1 to 6 of 6
  1. #1
    crigur is offline Member
    Join Date
    Sep 2008
    Posts
    2
    Rep Power
    0

    Default Runing 44 Java Files Easyer

    Ok im new to java started about 2-3 days ago, I was able to create 44 .java files there all basic System.out.println I then turn them into 44 .class files I run them from the command promt by typeing java *Filename*.

    ---This is what they all basically look like---

    class file34 {
    public static void main(String[] args) {
    String str;
    str = "Right!";
    System.out.println(str);
    str = "Right!";
    System.out.println(str);
    }
    }

    What can I do so that I don't have to type that whole java flie34, like I just have to type 34 and I get all the print out data. Like make it into a application or something.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,558
    Rep Power
    25

    Default

    Write a batch/script file that contains the full commandline.
    Give the batch file the short name.

  4. #4
    crigur is offline Member
    Join Date
    Sep 2008
    Posts
    2
    Rep Power
    0

    Default

    I need to turn these 44 java files into a Applocation is basically what im asking. And How do I do it? there all "public static void main(String[] args)" so I need a way to trigger them all with one application.

  5. #5
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,558
    Rep Power
    25

    Default

    I need a way to trigger them all with one application
    Do you want to start each one in its own JVM or can they all run in the same JVM?
    turn these 44 java files into a Applocation
    Write a 45th program that calls the main methods for the other 44, Add the following to the 45th program:
    Java Code:
    file1.main(new String[] {});
    file2.main(new String[] {});
       ...
    file44.main(new String[] {});
    Then execute it by : java file45

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. Behaving text files like binary files
    By Farzaneh in forum New To Java
    Replies: 2
    Last Post: 08-27-2008, 03:20 PM
  2. conversion of java .class files to .java files
    By kotturupraveen in forum New To Java
    Replies: 2
    Last Post: 06-09-2008, 12:58 PM
  3. Trouble in Runing
    By kavithaprabhaker in forum New To Java
    Replies: 5
    Last Post: 05-13-2008, 05:59 AM
  4. JAR file with .java files
    By ravian in forum New To Java
    Replies: 7
    Last Post: 12-24-2007, 08:15 PM
  5. How to search files with Java
    By karma in forum New To Java
    Replies: 1
    Last Post: 05-26-2007, 01:25 PM

Posting Permissions

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