Lost Password?

Go Back   CodeCall Programming Forum > Software Development > C and C++

Unregistered, Check out the Coder Battles in the Announcement and Game forums.

C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-2007, 04:17 AM
strowa65 strowa65 is offline
Newbie
 
Join Date: Dec 2007
Posts: 4
Credits: 0
Rep Power: 0
strowa65 is on a distinguished road
Default Linking C++ and Java

Hi,

I've written my source code in C++. I want to link it with an applet which will accept the input and show the output. Is it possible or, do i have to convert my source code to java
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 12-05-2007, 05:44 PM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 429
Credits: 29
Rep Power: 8
G_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura about
Default

I'm not sure it can be done via an applet because the class files are downloaded locally.

You can link it into a Java application via JNI but unless you have a load of code I wouldn't bother and would rewrite it in Java.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-05-2007, 11:21 PM
strowa65 strowa65 is offline
Newbie
 
Join Date: Dec 2007
Posts: 4
Credits: 0
Rep Power: 0
strowa65 is on a distinguished road
Default

it is nearly 1000 lines of code...and i know just the basics of java, so will learning JNI take time? I have a deadline too...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-06-2007, 01:52 AM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 429
Credits: 29
Rep Power: 8
G_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura about
Default

That's probably borderline. JNI is doable but like I said, it doesn't work with applets.

Interfacing C with Java in Linux - The JNI Solution

That shows you how to link C code with Java. Shouldn't be too difficult to expand it to C++.

Putting a Java Interface on your C, C++, or Fortran Code

Here's another guide that works in more general terms.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
questions about java games stack Java Help 3 07-02-2007 05:35 PM
MS-SQL deadlock and hang the Java application reachpradeep Database & Database Programming 1 03-11-2007 04:20 AM
Java Facts techni68 Java Help 0 01-17-2007 01:41 PM
John's Java Tutorial Index John Java Tutorials 0 01-11-2007 03:05 PM
Java Help Files xXHalfSliceXx Java Help 3 11-28-2006 11:30 PM


All times are GMT -5. The time now is 05:05 AM.

Contest Stats

Xav ........ 1097.16
MeTh0Dz|Reb0rn ........ 986.37
morefood2001 ........ 850.04
John ........ 841.93
WingedPanther ........ 684.54
marwex89 ........ 638.26
Brandon W ........ 493.36
chili5 ........ 292.12
Steve.L ........ 188.37
orjan ........ 187.41

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 79%

Ads