Hello all, had a hard time deciding where to post this question, but finally decided to do it here because it seems to relate to the lifecycle of the JVM.I am writting a server (SocketServer-handler thread implementation) and right now it has all been a breeze, it starts, binds to its port, ...
2169 byte By
eugn at 2007-9-26 5:44:40
I cannot run Dining Philosophers or Star Field or Nuclear Plant applets from the Applet Archive section of http://sun.java.com/applets/. I have tried running them with both JRE 1.3.1 and MS VM. I do not have any other version to test them with and there is no source to try and recompile but it ...
Hi,Is there any way in java so that I can determine whether a particular program is currently running on the OS, or not?Thanks,Vimal
I am trying to embedd JVM in my C++ application through JNI. I am using JDK1.4 Beta2. There are couple of issues I am facing..1. When I call JNI_GetDefaultJavaVMInitArgs with version set to JNI_VERSION_1_2, the call succeeds but the string represnting classpath contains null. And when I change ...
When I specify that I want to use the JIT compiler, and an exception occurrs and the stack trace prints, I get "compiled code" where I should get a line number. When I use the standard compiler, i see the line #. Is there any way to use the JIT AND see line #'s?
1871 byte By
linss at 2007-9-26 5:47:41
I've problem of setting system properties to JVM.My java program seems not running on the created JVM, so it cannot get the system properties set for the JVM. What the java program get is only the current enviroment "java.lang.class", rather than the one set in the C program.Thanks for any ...
I have installed java com api package, run BlackBox or serialDemo have no problems. However, when I use another program, apdutool, to direct output to com port where a card reader is attached, it return javax.comm returned NoSuchPortException. On the command line, I have tried -s0 up to -s4, or ...
Hi,From within the Java code I want to use the functionality of an existing C API. The dll's of C are available. Is it possible to directly call the C Api using Jni or some other technique or do I need to implement a native method in C which would Use the existing C Api to get the values and ...
i need that my applet will read a dll i gave in his policy AllPromisions but still he dont find the dll what i should do?Urgent
I have been trying to call a method into a java class from JNI C++ dll. I follow the following steps..1. CreateJVM2. FindClass3. GetMethodID4. CallIntMethod [ Method has signature int MyMethod(string , string)].Everyhting works ok till GetMethodID. Then I create new string using NewStringUTF ...
500 byte By
RTDog19 at 2007-9-26 5:55:36
I have a native method that returns a handle to some c++ object that I later pass as a parameter to another native method. I store the pointer as a java int through the return code. I noticed in some other posts (eg. http://forum.java.sun.com/thread.jsp?forum=52&thread=165499 ) that a long ...
871 byte By
adco at 2007-9-26 5:56:48
Hi all ;Beeing new to JNI I don't know how to explain this thing:I am working with the basic "HelloWorld" example from the jni toutorial (it simply dispalys "HelloWorld!" on the screen). I have a package from which I want to call the HelloWorld.displayHelloWorld() (that I added to my pacakge ...
1955 byte By
knoxor at 2007-9-26 5:57:38
Hi,I am having a problem registering a java class using the CAS-COM Bridge gentypelib tool.The java class I am trying to register uses native code in the form of dll's.When I try to register the class I get the following error below.I have looked up the exception and it says that the JVM ...
Could somebody point me to a HelloWorld JNI tutorial.Maybe one that could show me how to execute a C# metod that returns an integer.Many Thanks,--Ian
Has anybody done this in linux with gcc?I tryed a HelloWorld sample and came up with a unreconized option "G" compiler error. Is there maybe a different flag for this compiler?Thanks,--Ian
302 byte By
benjamca at 2007-9-26 6:01:22
I am looking to build iostream interfaces between C++ and Java - I cannot quite get how this is done with the tutorials as far as how the the native method passes back a reference to an object. I have to build this interface for a Java application using a data acquisition system. Thanks! ...
can anybody tell me the site/docs from where i can have the basics and advanced theoretical stuff of JVMregardspawan
Folks, I just wrote some little program that generates a DLL out of aset of Java classes. Now I wonder where I can announce this suchthat others may recognize it.Any suggestions: jvh@b-novative.de
2163 byte By
safir at 2007-9-26 6:09:24
hi,i made many modifications to my web surfing program, but haven't figured out why this happens. I've tried running more than 15 times. I enclose some details on what the program does:>> stores links in an array to provide self-feeding capability>> stores the same links in an ...
910 byte By
sliechti at 2007-9-26 6:11:08
Hello:I have a file called kara.jar at work where I can excecute it, and work with it without any problem... now I have the same file at home and comes the message "main class could not be found, program will exit!"... my question is why? I have the same JRE at home and at work! and the same ...
I've got a problem when trying to retrieve "args" argument in java class main methodmy C code is equivallent to : void MyFunction() { ... mid = env->GetStaticMethodID(cls, "main", "([Ljava/lang/String;)V"); env->CallStaticVoidMethod(cls, mid, "ABC"); ... }my java code is equivallent to : ...
I am trying to invoke jvm through .exe file. It is doing so when I specify the path of jvm.dll in the environment variables. I am using win 2000. Now I want to install this application on different machines which may have different paths to jvm.dll. I need to specify the path to jvm.dll at ...
155 byte By
erada at 2007-9-26 6:15:52
How I interact with twain technology?I must develop an application able to capture an image from a scanner and store it in a database.
482 byte By
iiq374 at 2007-9-26 6:17:18
Hi,I'm trying to print things in a native method by invoking a calling in my test main of my java program. However, the printf's in my native method are not printed to the screen until after ALL of my System.out.println calls in my main are printed to the screen (even the ones that are ...
599 byte By
iiq374 at 2007-9-26 6:17:20
I need to interface to an existing library of C functions which have the property of input parameters being used as output.IE a C function may have the signature: int NWDS_PING(char *node, NWDS_ITEM_LIST *item_list).The string node is used both as input and output for the function with the int ...
I'll hunt through the source to see if I can turn anything up, but does anyone know if there is any significant cost to making a lot of calls to Runtime.freeMemory() and/or totalMemory()?I've got a server that caches objects, and memory is currently managed pretty well with soft references, ...
1244 byte By
gafclass at 2007-9-26 6:22:43
I have an existing C++ library that I need to make available from Java. The library itself is not multithreaded, but it has some global data that it protects using Posix (i.e. native) mutexes. I have no problem with the JNI layer making the library callable, with the exception of the ...
We are using the system property, file.encoding, to set the default character encoding for the JVM. On an English NT OS we start the Java process using -Dfile.encoding=UTF-8. This seems to work fine and sets the default encoding.But on a Japanese NT OS, it does not pick up the encoding setting. ...
Hi,I have 2 problems with my JNI code:1 - I created MyException class in Java. And my native method throws this using:jclass JExpClass = env->FindClass("package/MyException");if (JExpClass != NULL) env->ThrowNew (JExpClass, "Example Exception");env->DeleteLocalRef (JExpClass);The ...
711 byte By
jumeelee at 2007-9-26 6:25:41
hi, supporter!i have two different set of web apps. (one is for just web user, and another is for admin. user)i wonder whether i run these two web apps same jvms or different jvms?is it any peformance differences?it has 2 CPUs.. in this case, i think jvm processor itself uses cpu and memory.. ...
1122 byte By
carlosnf at 2007-9-26 6:26:44
Hi,My directory structure is as follows:C:\A\B\CI have 3 class files and 1 dll1.>class2.>class3.>class>>my.dllI have no problem while running this.The problem is when I add package ...
Hello !My C code contains two functions to implement JNI for Java methods invocation :- InitFunction loads JVM and stores class to call :{JNI_CreateJavaVM(...)cls= ...->FindClass(...)/* g_cls is a global variable */g_cls = ...->NewGlobalRef(..., cls)/* g_myMethod is a global variable ...
370 byte By
achalk at 2007-9-26 6:33:37
I have a C function prototyped as:int func(int *Num)Num is used to pass data but is modified in the function.I want to call func() from Java and get the new value of Num back. Since primitives are passed by value, how do I specify the Java prototype?I.e. public native int func(<WHAT GOES ...
1621 byte By
Botella at 2007-9-26 6:34:37
javap reports that the toString method of the class String is invoked when it should be the toString method from the class StringBuffer.Given this programpublic class Test2 {Test2() {String a ="a", b ="b";System.out.println(a + b);}}the javap output isMethod Test2()0 aload_01 invokespecial #1 ...
1956 byte By
abhiSD at 2007-9-26 6:36:02
Hello, I am currently learning JNI and I have come across a problem. I need some advice on it. My Java File : Addition.javaclass Addition{public native void add(int a, int b);static{System.loadLibrary("addition");}public static void main (String ax[]){try{int a = Integer.parseInt(ax[0]);int b = ...
1956 byte By
abhiSD at 2007-9-26 6:36:04
Hello, I am currently learning JNI and I have come across a problem. I need some advice on it. My Java File : Addition.javaclass Addition{public native void add(int a, int b);static{System.loadLibrary("addition");}public static void main (String ax[]){try{int a = Integer.parseInt(ax[0]);int b = ...
611 byte By
Ddavidjd at 2007-9-26 6:37:10
Hi,I have to use a .so library (Solaris) from another company. As this library has not the correct syntax to be accessed from JNI, I made another .so that calls it.For compile this library I just need the header file and I can compile it succesfully, but when I run it, throws an ...
This little command stopped me in my tracks forabout an hour last week and I would like to share it with any one who may need it. When trying to compile a native method in C, Java and gcc here is the command: gcc -o outfile.so hellowrold.c -shared -fpic-lcrypt ...
I have an application written in java that runs as a daemon. It uses close to 100 megs of memorywhen all its data is loaded. I would like to release this memory after the daemon has been querried. I write all the data to files on disk and then reset the hash tables with a small initial ...
Hi all,I'm having a problem running any kind of application with my JDK. When running with J2EE1.3_01 the following occurs when I shut down any kind of application: "An unexpected exception has been detected in native code outside the VM.Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred ...
Hi,We are having a GUI intensive JAVA application built with AWT components,The approximate size of the JAVA code is about 80 KLOC and about 75 GUI screens. We are testing the application in Solaris 8.0 , Java JDK 1.3.1 , with Hotspot Client option, with the default heap size of 64 MB and 1 GB ...
i have windowsXP.wrote "helloworld" program and have problem:#HotSpot Virtual Machine Error : EXCEPTION_ILLEGAL_INSTRUCTIONError ID : 4F530E43505002C4 and can't do anything!Help!
1261 byte By
mamlason at 2007-9-26 6:45:07
Just in case some of you Sunnies read this:I really don't like that information on hot spots in codegets thrown away... could you please:1) Add a persistent cache of hot spot information which has been gathered so far, and/or2) Implement HINTS in method attributes inside classfile which say ...
1039 byte By
aKaresz at 2007-9-26 6:45:09
Hi everybody,I'm encountering a rather weird problem; When executing the following command (from a batch file on NT 4.0):java -cp c:\jaxp-1.1\xalan.jar org.apache.xalan.xslt.Process -in %1 -xsl %2 -out %3I get the following error:javax.xml.transform.TransformerFactoryConfigurationError: ...
HiI am using JNI so I can use some c functions in Java. One of the functions returns a char array in ascii. The char array in JNI is 16 bit unicode.How would I go about converting between ascii to unicode and also unicode to ascii.I would be greatful for your help.Thanks. ...
I know this has probably been posted before, but I don't understand the responses, and they are quite old.I have about 1G RAM I deliberately bought so that I could test a self-built 3D Java API, but it doesn't even get to about 60Mb before java.lang.outOfMemoryError.At my university ...
Can anyone explain me the term "System.out.println?"I m askin this basic y cuz the "System" class belongs to lang package and it does not have any method called "println".But this println() method belongs to the class "PrintWriter" class which is in IO package.I understand that lang package ...
Hi,When my Java class containing the interface definitions and the DLL containing the implementation are in the same directory, everything works fine.I put the Java class with interface defs in a package. I ran javah from the directory where the Java class file was and the header file contained ...
I am running through each element of a hash table using the keys() method which returns anenumeration. Some values I will wish to remove from the hash after I view them while I am still enumerating through its keys. Can you do this without causing an error in the next call ...
1272 byte By
jverd at 2007-9-26 6:51:13
Over in "Advanced Topics", http://forum.java.sun.com/thread.jsp?forum=4&thread=167222dnoyeB and I are having a spirited discussion about the mechanics of thread working copies vs. main mem's master copy. It's a *very* long discussion that spawned off from somebody else's simple question ...