Results 1 to 2 of 2

Thread: Specify path

  1. #1
    borgrodrick is offline Member
    Join Date
    Feb 2008
    Posts
    1
    Rep Power
    0

    Default Specify path

    I have an assignment and was given a code which I must add to it. In it there is specified a path which I have to reference it to a path on my C: (a .txt file). The part is somthing like this:
    "GenerateContainers gc = new GenerateContainers(path);"

    I need to reference the path to a .txt file in the C drive.

    I`m dooing somthing like this but I`m getting an error

    path = c:/terminal.txt

    Can Someone please help!!!

  2. #2
    taicode is offline Member
    Join Date
    Feb 2008
    Posts
    3
    Rep Power
    0

    Default

    I'm trying to take a shot at this. I'm very new to Java, so pardon me if my suggestion is not the best solution.

    In the GenerateContainers(path) constructor, the path type is IPath, or rather an interface, that may be why it's not taking your path as a type String as you indicated with path = c:/terminal.txt. Building a path first may be necessary to return an IPath type path with the fromOSString(String pathString) method call, which need to import "org.eclipse.core.runtime.Path". Please give this a try:


    GenerateContainers gc = new GenerateContainers( fromOSString( "c:/terminal.txt" ) );

    I still trying to figure out how to install eclipse, so I can't yet test the above suggestion.

Similar Threads

  1. trying to get class name & path
    By sandor in forum New To Java
    Replies: 4
    Last Post: 08-12-2008, 02:38 PM
  2. Log4J.jar in class path
    By eva in forum New To Java
    Replies: 0
    Last Post: 01-02-2008, 07:39 PM
  3. Setting Java Path
    By bugger in forum New To Java
    Replies: 2
    Last Post: 11-22-2007, 10:48 AM
  4. problem with PATH
    By creativehacker in forum New To Java
    Replies: 4
    Last Post: 07-11-2007, 03:54 PM
  5. Specifying absolute path in web.xml
    By Felissa in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 07-05-2007, 07:56 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
  •