how can compile cpp code containing references to java classes


 
Thread Tools Search this Thread
Top Forums Programming how can compile cpp code containing references to java classes
# 1  
Old 10-06-2008
Java how can compile cpp code containing references to java classes

hi
there is example (on link given below )of such code that contains java class reference in c++ program.


http://slackware.cs.utah.edu/pub/sla...-Monitor-HOWTO

I am new in linux environment. and not able to compile it.
when i compile it through gcc it gives error regarding java classes like StringTokenizer.
plz tell how i can compile such code.
# 2  
Old 10-07-2008
I can't find any references to Java stuff at the link you mentioned. By the way, the code is C, not C++.

I'm not sure if that is what you meant, but integrating Java and C/C++ code involves the Java Native Interface (JNI). I was once engaged in heavy JNI work about 6 years ago at college but have almost entirely forgotten most of it, because I have forgotten most of C/C++ myself.

The coverage of JNI has been stripped of the Sun Java tutorial for many years, probably due to lack of interest. If you want to find more information, you will need to search for older documents. I dug this up in an early version of the Java tutorial:

Integrating Native Code and Java Programs

Good luck, because it is very easy to crash the JVM with JNI.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Java Abstract Classes

Can anyone tell me if this is correct when creating classes in Java? public abstract class Animal { public class Point { public int x,y; } public class Animal { protected Point loc; protected String name; protected Random rng; String... (3 Replies)
Discussion started by: totoro125
3 Replies

2. Programming

Set java classes path

I add some new java jar files in the old project, how can I edit the class path? How can I compile all the java classes by just type 'C':o (3 Replies)
Discussion started by: Hscript
3 Replies

3. Shell Programming and Scripting

Difficulty cleaning references to duplicated images in HTML code

Hi, I need to search and replace references to duplicated images in HTML code. There are several groups of duplicated images, which are visually the same, but with different filenames. I managed to find the duplicated files themselves, but now I need to clean the code too. I have a CSV file with... (9 Replies)
Discussion started by: mdart
9 Replies

4. UNIX for Dummies Questions & Answers

How to compile and run java in UNIX?

Hi Im using MobaXterm Unix on my windows XP.I want to compile java in unix.I have installed java to the following path C:\Program Files\Java\jdk1.7.0_09\bin In order to compile the java prog im typing the following command after entering into the bin directory: C:\Program... (2 Replies)
Discussion started by: ak3141
2 Replies

5. UNIX for Advanced & Expert Users

java compile and run program help

What is the trick to get a java program to run and compile? I can't even get a basic skeleton to run and compile. What packages do I need? I figured the java-gcj and gcc-java packages was enough. Do I need any other packages? I thought I had to do this and it would work but its not. javac... (1 Reply)
Discussion started by: cokedude
1 Replies

6. UNIX for Dummies Questions & Answers

Compile & Run Java Code

The java program is a part of speech tagger -> The Stanford NLP (Natural Language Processing) Group The goal is to use this script as part of a webpage to tag parts of speech based on a user-inputted string. I have no idea what to do with the files - I'm a complete *nix noob. I tried running... (4 Replies)
Discussion started by: tguillea
4 Replies

7. HP-UX

Compile .java

How would I go about compiling a .java file into a .class file? (1 Reply)
Discussion started by: Tecron
1 Replies

8. UNIX for Dummies Questions & Answers

trying to compile and run java through the terminal

Hey everybody, Ok here is my problem. I have this code that that compiles, but when i go to run it it gives me errors. I stored my simple java class here: /user/workspace/getMailFromSafeDoc/src I store my mail.jar file here: /user/workspace/getMailFromSafeDoc/lib/javaMail/javaMail.jar ... (2 Replies)
Discussion started by: killesk
2 Replies

9. Solaris

how to compile and run java programs

Hi, I have installed Solaris 10 on a VMware. How to compile a java program as there is no javac in 'bin' directory. Thanks in advance for answers and sorry if the question is soo basic. (3 Replies)
Discussion started by: mayahari
3 Replies

10. Shell Programming and Scripting

How to call Java classes/methods from ksh

Hi all, i am new to shell scripts and have one doubt. Can we call ava classes/methods from shell scripts? if yes how? (17 Replies)
Discussion started by: girish.sh
17 Replies
Login or Register to Ask a Question