Results 1 to 4 of 4

Thread: Eclipse relative class path help

  1. #1
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts

    Eclipse relative class path help

    Guys and Gals,
    I'm currently developing an eclipse java project which has to connect to an oracle database. The JDBC driver is attached to the project as a specific location (e.g. C:\project\code\JDBC.zip).

    This works fine, however after exporting the project to a .jar file and moving it to a web server the program will not work (because obviously it does not know C:\project\code\JDBC.zip).

    Is there any way of specifying that the JDBC driver is stored in a location relative to the other java files? (For example, "\code\JDBC.zip"). I have tried modifying the .classpath file to no avail.

    Please help!

    Thank you in advance

  2. #2
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    Dammit I have put this in the wrong forum, mods can you please move this to the software development forum please? Thanks

  3. #3
    DsW
    DsW is offline
    Senior Member
    Join Date
    Aug 2003
    Location
    Glasgow
    Posts
    292
    Thanks
    0
    Thanked
    0 times in 0 posts
    Quote Originally Posted by Big Leon
    Guys and Gals,
    I'm currently developing an eclipse java project which has to connect to an oracle database. The JDBC driver is attached to the project as a specific location (e.g. C:\project\code\JDBC.zip).

    This works fine, however after exporting the project to a .jar file and moving it to a web server the program will not work (because obviously it does not know C:\project\code\JDBC.zip).

    Is there any way of specifying that the JDBC driver is stored in a location relative to the other java files? (For example, "\code\JDBC.zip"). I have tried modifying the .classpath file to no avail.

    Please help!

    Thank you in advance
    The .classpath file is only of relevance within the Eclipse environment.

    Once you've exported the project as a JAR it's upto you to specify any required resources in the classpath via the command line or in the web application configuration.

    e.g. java -jar yourjar -classpath=.;.\code\JDBC.zip

    cheers,
    dave

  4. #4
    LWA
    LWA is offline
    Senior Member
    Join Date
    Jul 2003
    Location
    London
    Posts
    2,171
    Thanks
    134
    Thanked
    57 times in 41 posts
    Dave, thanks for the reply that is very helpful. Just need to setting the class path when I run the java file.

    Thanks again, Leon

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Eclipse is still in the suppliers lest
    By prehensile in forum Retail Therapy and Bargains
    Replies: 8
    Last Post: 27-07-2004, 12:23 PM
  2. If u vote ur a mupppet!
    By revol68 in forum Question Time
    Replies: 18
    Last Post: 02-02-2004, 03:11 PM
  3. Just how working class...
    By Stewart in forum General Discussion
    Replies: 17
    Last Post: 23-01-2004, 08:31 PM
  4. suspicious aftersales at eclipse
    By prehensile in forum Retail Therapy and Bargains
    Replies: 25
    Last Post: 05-12-2003, 12:46 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
  •