Solved

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

Posted on 2016-08-13
3
40 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 74

Accepted Solution

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

e.g.

System.@Is.Something
1
 

Author Comment

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

Author Closing Comment

by:Johann2
Comment Utility
Cool! Safes me a lot of work. :)
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Paging GridView 7 32
c# code 19 57
Installing IIS after Visual Studio 2015 Community Edition 5 16
Unable  to create new object 9 19
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now