Results 1 to 7 of 7
  1. #1
    doug99 is offline Member
    Join Date
    Apr 2008
    Posts
    5
    Rep Power
    0

    Default eclipse batch file

    Have a couple questions.

    Is there an easy way of running a batch file from Eclipse?
    Also, for this project I just have jar files. I also have the source code located somewhere else. Can I debug somehow by attaching source. How do you do this and how to set breakpoints.

    Thanks

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    7

    Default

    "batch file", you mean .bat file / .sh file ?. You can create that file and run it by double clicking (Opening it with default editor/ system editor). I havent tried .sh but should be okay.
    Somewhere else, as long it is in local or accessible network place you can click on properties(After you put the jar file in build path) and look for source attachment.

    After the source location is attached to jar file. Open the class file from jar. You will see source displayed. You can put breakpoint on it just like other regular java source files.
    dont worry newbie, we got you covered.

  3. #3
    doug99 is offline Member
    Join Date
    Apr 2008
    Posts
    5
    Rep Power
    0

    Default

    I tried running my .bat file and it does attempt to run but I'm getting a can find main class error. If I run it outside of ecipse(DOS, or Explorer) it works OK. It's running a main that is contained in a jar file. The project properties includes the jar files in the java build path.

  4. #4
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    7

    Default

    can you paste the content of your bat file ?? (or PM)

    First put the jar file in the build path (Right click > Build path > add to build path).
    Then right click the jar file inside the referenced library (Search for the jar file in project structure). Click on properties. You will see it.
    dont worry newbie, we got you covered.

  5. #5
    doug99 is offline Member
    Join Date
    Apr 2008
    Posts
    5
    Rep Power
    0

    Default

    start /min "Program" java -Xmx500M -cp ../lib/thejar.jar it.program

    where it.program has a main. This works OK when I start the script from DOS command line. The jar file is in the build path

  6. #6
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    7

    Default

    Try with full path for ../lib thing ..
    dont worry newbie, we got you covered.

  7. #7
    doug99 is offline Member
    Join Date
    Apr 2008
    Posts
    5
    Rep Power
    0

    Default one more question

    the full path did work thanks.

    One more question. This .bat file launches a java program. How do I launch in the debugger using the .bat file?

Similar Threads

  1. Replies: 0
    Last Post: 04-04-2008, 02:48 PM
  2. run a batch file as windows nt service
    By radhika123 in forum New To Java
    Replies: 0
    Last Post: 04-04-2008, 01:46 PM
  3. How to run/build the JSP file using Eclipse
    By cbklp in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 01-19-2008, 12:03 AM
  4. Problem in batch file
    By marwa in forum New To Java
    Replies: 0
    Last Post: 08-14-2007, 10:24 AM
  5. An Introduction to Eclipse PDE - File Creation
    By JavaForums in forum Eclipse
    Replies: 0
    Last Post: 05-09-2007, 06:40 AM

Posting Permissions

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