Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

VM Options

 
Ryan Bailey
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone please specify what I need to do in order to include system properties in my Java Program. I believe the program is expecting to read some values from a properties file. I want to include these values to the VM when it starts. My understanding it to do the following....
java -D onewire.adapter.default={DS9097E} onewire.port.default=COM1 javaClassName
when I do that I get a NoClassDefFoundException. That error tells me that my classpath is incorrect. When I run without the -D option it runs fine, but can not find the system properties that I need to provide. So why is it when I specify properties on the command line, it's expecting something else in the classpath. "Oh classpath....Why do you hate me ?"
Thanks in advance for you help,
Ryan
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't have any embedded spaces in the property flag. Try:
 
Marilyn de Queiroz
Sheriff
Posts: 9065
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
moving to JiG(intermediate) since this is not a beginner's question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic