Hello Experts!
I'm using Visual Studio .NET with J#.
For example if you compile a java file by using the javac in the command
window(cmd) you get a class file.
One example if you have a java file called Test.java and you compile this
file
from the command window you get a Test.class file.
How to I import this class file Test.class so I can call methods that exist
in that file.
I have tried everything to set the classpath and I have put this classfile
Test.class
at the project folder and at the folder where the exe file is located.
Nothing works.
I have tried from Visual Studio In the "Project" menu "Add existing item..."
Locate the
files and "OK". But this didn't help.
Does anybody know if it's possible to use a class file when you use Visual
Studio .net. How do I do?
//Tony
Lars-Inge Tønnessen [VJ# MVP] - 09 Jun 2005 20:20 GMT
Hi,
You can not import java binary code into J#. Please recompile the java
source files into a J#.NET library, or use the jbimpl tool to make a DLL
library from the java byte code files. When you have the DLL library, add a
reference to it in the Visual Studio IDE.
c:\> jbimp.exe /target:library /out:MyLib.dll *.class
"Add a reference" to "MyLib.dll" in Visual Studio under the project menu.
We don't have the classpath in J#.NET. Please put the DLL in a path where
your app can find it (if you compile J# from the command prompt). Visual
Studio will do this for you when you add a reference to it.
Regards,
Lars-Inge Tønnessen
Tony Johansson - 09 Jun 2005 20:24 GMT
> Hello Experts!
>
[quoted text clipped - 18 lines]
> Does anybody know if it's possible to use a class file when you use Visual
> Studio .net. How do I do?
I forgot to tell you that the problem that I have is that I get compile
error saying "Cannot find class Test" if the class is called Test.
> //Tony
Lars-Inge Tønnessen [VJ# MVP] - 11 Jun 2005 13:14 GMT
> I forgot to tell you that the problem that I have is that I get compile
> error saying "Cannot find class Test" if the class is called Test.
Does the class belong to a namespace/package?
Eg:
myNameSpace.Test on = new myNameSpace.test();
Regards,
Lars-Inge Tønnessen