Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » eclipse doesnt like this line of code(problem with line of java code copied from demo)
eclipse doesnt like this line of code [message #1817633] Wed, 27 November 2019 04:40 Go to next message
keith abbott is currently offline keith abbottFriend
Messages: 2
Registered: November 2019
Junior Member
Hi,

Im new to eclipse, and java and axl

I copied demo code from the cjsco developer site in the docs - axl section called !hello-world-with-java/hello-world-with-java

Presumably the code is good but eclipse flags this line:

String AXLRequest = "<soapenv:Envelope xmlns:soapenv="*****//schemas.xmlsoap.org/soap/envelope/" xmlns:ns="####//www.cisco.com/AXL/API/8.5">";

(substitute the ***** with https: and the #### with http: )
with this error:
Syntax error, insert ";" to complete LocalVariableDeclarationStatement

why? and how do I resolve it?

thanks
Re: eclipse doesnt like this line of code [message #1817636 is a reply to message #1817633] Wed, 27 November 2019 05:42 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

This isn't really the place for general Java questions, but as String literals in Java are marked by surrounding text with double quotes, you can't have double quotes in the String contents without escaping them with a backslash.

https://docs.oracle.com/javase/tutorial/java/data/strings.html


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: eclipse doesnt like this line of code [message #1817700 is a reply to message #1817636] Thu, 28 November 2019 03:34 Go to previous message
keith abbott is currently offline keith abbottFriend
Messages: 2
Registered: November 2019
Junior Member
Hi Nitin,

Thanks for the info - since this was from demo code I did not expect to need to modify it out of the chute, so I suspected it was an eclipse oddity. But escaping the extra quotes eliminated the error . The modified line was:

String AXLRequest = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://www.cisco.com/AXL/API/8.5\">";

Previous Topic:When do forum messages actually post?!
Next Topic:What are the best ways to get answers with Eclipse use?
Goto Forum:
  


Current Time: Thu Apr 18 23:06:21 GMT 2024

Powered by FUDForum. Page generated in 0.03066 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top