aspose file tools*
The moose likes JBoss/WildFly and the fly likes Is this writting for JAVA_OPTS correct? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Is this writting for JAVA_OPTS correct?" Watch "Is this writting for JAVA_OPTS correct?" New topic
Author

Is this writting for JAVA_OPTS correct?

Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 61
A Jboss AS is installed on Linux. I see in the file jboss followings. I am not sure if the definition writting for JAVA_OPTS correct or not





I think it should be followings:


The difference is the position or usage of "

Which one is correct?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Neither. It should be:



Always put the quotes around everything after the equals sign when setting env vars in Linux


JBoss In Action
Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 61
Peter Johnson wrote:Neither. It should be:



Always put the quotes around everything after the equals sign when setting env vars in Linux


But I use the followings and it works.

Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
Thomas Chang wrote:But I use the followings and it works.



It may work in some cases, but it is highly dependent on the value. If the values have no spaces (or other special characters), it can work. If the values have spaces it will break.

If you don't understand why, you should get a book on UNIX Shell Programming, as it will cover how to set environment variables, and why you need to quote them. For now, if you want it to work all the time, you need to do as Peter said. It is the only correct way to do it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is this writting for JAVA_OPTS correct?