Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Visual J# / June 2005

Tip: Looking for answers? Try searching our database.

How do I import a user defined class into VisualStudio .net J#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony Johansson - 09 Jun 2005 19:20 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.