• Post Reply Bookmark Topic Watch Topic
  • New Topic

classpath on two different machines  RSS feed

 
Frank Sikuluzu
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • 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 ?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!