Solved

Using java code in .Net/c#: namespace issue

Posted on 2016-08-13
3
57 Views
Last Modified: 2016-08-14
Hello.

I'd like to reuse serveral java libs I wrote from within C# programs. For this purpose, I converted several jars to dlls using ikvmc.
After adding "using" directives to my c# sources, I faced an error, complaining that "is" is a keyword.  The reason: One of my Java namespaces contains "is", e.g. "my.namespace.is.not.ok" -> c# does not accept "is" as part of a namespace.

Question: is there a workaround allowing me to still keep the Java namespaces? If not, is there another solution than just altering the Java code?

Thank you,
Johann
0
Comment
Question by:Johann2
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 41755146
Not sure if it works for namespaces, but try prefixing "is" with an @:

e.g.

System.@Is.Something
1
 

Author Comment

by:Johann2
ID: 41755367
..yes, it works! Perfect! Thank you very much for your help. :)
Regards,
Johann
0
 

Author Closing Comment

by:Johann2
ID: 41755369
Cool! Safes me a lot of work. :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question