Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Files recognized on my computer but not another???

 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have created a software application written in Java. When it executes on my machine it works perfectly. I'm then putting it on a disk or zipping it up and sending it to someone else. Once they place the folder on their c:\ drive, it doesn't work. It seems as though it is not recognizing certain folders/files.
Both machines are using Windows, and both are being placed in the same folder. My C drive is just c:\. His C-Drive has a label. I think this is what is effecting the program.
How can I recognize the 'universal' C-Drive so that my program will work on any Windows OS??
Regards,
Brian Snyder
 
marilyn murphy
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A label on the drive should not affect the Java application. Does he have the JRE on his computer? Are the files the app is looking for .class files? Are you using native methods?
 
Brian Snyder
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, he has the JRE. and yes it is looking for a .class file.
???
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your classpath has the c: drive in it, and his does not you would get this behavior. The solution is to insure that his classpath gets updated to include the place that you put your files OR to reset the classpath just before executing your file.
In a .bat file you can have
set classpath = whatever;
java myApp
Then just double click the bat file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic