Assume someone wanted to open a real estate office and wanted to use the name Java Realty, would that violate the Java (programming framework) trademark?
A basic rule of trademark law is that a trademark is protected only for use in the same industry, or in regard to the same general sort of thing. "Maxwell House" for example, is the name of a brand of Coffee, and no doubt a trademark. If A business used it as the name of a brand of mobile home, it would not infringe the mark of the coffee brand.
Who would sue?
The island in Indonesia, The Nickname for Coffee, the Programing language, now in it's 8th version, the scripting programing language that has no relationship at all to the first programing language but used Java cause the first language was the it item when the second language came out and they wanted a piece of the action that came with using the word "Java"?
Suffice to say, you wouldn't be the first, and the first two uses are too generic and the second two clearly have a possible suit to deal with, but the first didn't go after the second and both are pretty popular now.
Your question could mean one of two things:
(a) If I get sued over the name "Java Realty", will I win?
(b) Is it wise to run the risk of getting sued?
I Am Not A Lawyer, But
If you are just starting out in business, then the answer to (a) is no, because once you are sued for something like this, only the lawyers will win.
Play it safe and pick another name.