• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

classpath on two different machines

 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a "MyCode.java" on my PC. In the code it uses a JDBC driver installed on my PC's "C" drive. So I included "C:\folder\jdbc\..." in the classpath and compiled the code to get "MyCode.class".
Now I will need to move this "MyCode.class" to my friend's PC. In his machine the JDBC driver is installed on "D" drive and at a differently named folder. Of course he included "D:/another_folder\jdbc\.." in his classpath.
Now, will the "MyCode.class" I created on my PC work in my friend's PC ?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, as long as his CLASSPATH points to the driver classes, which will be needed at runtime. The .class files don't contain any path information regarded where they were created or where any other classes were located when the .class file was compiled.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic