|
Hello Friends
I am crating one applet based application.Now I want to run that on another system where jre is not available.So,can I use jre that Installed on my system by copying to another one and How can I use then that copied jre?
Or is there any other way to bundle jre with application so that when I try to run that application on any other system where no jre then this bundled jre get in use to run my application.
In actual I want to run my applet when My jre is at some different location other than installed one.
Any Help will be appreciated.
Thanks & Regards
Yogesh
modified on Friday, July 30, 2010 2:38 AM
|
|
|
|
|
I don't think this is possible. Any java app or applet needs to be able to find the registered JRE on the machine where the app/applet is to be run.
It's time for a new signature.
|
|
|
|
|
Is this an applet or an application?
If it is an application then you can simply include the JRE in a directory along with your application distribution and then run the application from that. The advantage of this is that you know which version of the JRE your application will run against, rather than being at the mercy of whichever random JRE happens to be installed as the default on the target machine. There is no need for any installation process or registration, you can copy the JRE directory and then point your application at this and away you go.
An applet is a different matter. If you want to run the applet from within a browser, then that browser must have a Java plug-in of the correct version installed and enabled. There is no way the applet can do this automatically. Normally, I would expect the browser to prompt the user with a message, something like "A required plug-in is missing for this page". In this case, the JRE does have to be properly installed and registered, and you cannot simply copy it over to the other machine.
|
|
|
|
|
Hi every body!
I'm Tu.I come form VietNam.
I need you help me wirte code a application monitor.
The first,this application can telnet in server by an ipaddress and port.
Then by execute commnad MML to managenment server.
Thanks you very must!
|
|
|
|
|
Sorry but we do not write code to order. Take a look at the articles here[^] and the tutorials here[^].
It's time for a new signature.
|
|
|
|
|
a simple google is your answer
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|
|
Hi all ,
I have the class file (HelloWorld.class) calls a native method, and the native library (Hello-World.dll) implements the native method.
While running the HelloWorld class I am getting following error:
Exception in thread "main" java.lang.UnsupportedClassVersionError: HelloWorld (Unsupported major.minor version 50.0)
Is this error releted to Java version?
I am using JDK 1.6.
|
|
|
|
|
The most likely cause is that the HelloWorld class was compiled to version 1.6 but you are trying to run it with a 1.5 JVM. Although Java is backwards compatible (a 1.6 JVM will run 1.5 code) it does not work the other way round.
|
|
|
|
|
|
Hi all,
Iam getting run time error in following function in jni.h:
return functions->FindClass(this, name);
Following is the FindClass() function call fron my cpp file:
cls = (env)->FindClass(servParams[i].lib);
Plz help , I am new to JNI Programming.
|
|
|
|
|
What is the actual error code or message that you receive? Also check the values of the various parameters you send to your functions. I also do not see the connection between the above two statements, the first accepts two parameters and the second passes only one.
It's time for a new signature.
|
|
|
|
|
Actually in jni.h following is the definition of FindClass
jclass FindClass(const char *name) {
return functions->FindClass(this, name); }
Following is the Error message I am getting at 'FindClass(this, name)':
Unhandled exception at 0x60edf3a0 (xxx.dll) in yyy.exe: 0xC0000005: Access violation reading location 0x00000000.
|
|
|
|
|
OK so trying to read memory address 0 indicates you have an uninitialized pointer. Check your code to see where your pointers are set up. More specifically check the code where you are calling FindClass() and ensure that your name parameter actually points to something.
It's time for a new signature.
|
|
|
|
|
Hey Richard,
Here in 'FindClass(this, name)' name parameter is pointing to some value but 'this' pointer is pointing to 0x00000000.
Plzz help........
|
|
|
|
|
ravi120486 wrote: Plzz help.
You will need to show some of your code, both Java and C for me to have any possibility of seeing how you are getting to this point.
BTW please don't rely to your own messages as I don't get a notification of the update.
It's time for a new signature.
|
|
|
|
|
I am not posting the entire code,Tell me if its sufficient
Following is my Code:
int MyAPI(Parameters* Params, int i) {
.
.
.
JNIEnv *env;
JavaVM *jvm;
JavaVMInitArgs vm_args;
char clspath[400]="-Djava.class.path=";
resCheckVM = JNI_GetCreatedJavaVMs(&jvm, bufLen, &nVMs);
if( resCheckVM < 0 || nVMs < 1 )
{
.
.
.
JNI_GetDefaultJavaVMInitArgs(&vm_args);
fflush(stdout);
res = JNI_CreateJavaVM(&jvm,(void**)&env,&vm_args);
if (res < 0)
fprintf(stderr, "Failed to Create JVM.\n");
}
else
{
fflush(stdout);
res = (jvm)->AttachCurrentThread((void**)&env, NULL);
if (res < 0)
fprintf(stderr, "Failed attaching current thread to JVM.\n");
}
cls = (env)->FindClass(Params[i].lib);
if (cls == 0)
{
fprintf(stderr, "Can't find Prog class \n",Params[i].lib);
return 1;
}
{
fprintf(stderr, "Can't find function \n");
return 1;
}
.
.
.
return 0;
}
Here I am getting this message "Failed to Create JVM."
Then a run time error at FindClass(Params[i].lib).
|
|
|
|
|
ravi120486 wrote: Here I am getting this message "Failed to Create JVM."
Well, I don't think anything will work after this. If you have not managed to instantiate the JVM then your application should die as there is nothing further it can do.
It's time for a new signature.
|
|
|
|
|
Hey Richard,
Can u tell me the reasons why JVM creation might have failed , so that i can loook for it .
Regards,
Ravi
|
|
|
|
|
You should check the JNI error code returned from your call to JNI_CreateJavaVM() ; I would also check the values of your input parameters prior to the call to ensure all are correct.
It's time for a new signature.
|
|
|
|
|
Ravi,
I have been doing some more testing and figure that some of your code is not needed and some needs correcting.
- The call to
JNI_GetCreatedJavaVMs() will never succeed as you do not have any created VMs at that point. Also this call is not used in newer versions so can be removed. - The call to
JNI_GetDefaultJavaVMInitArgs() is no longer necessary and does not serve any purpose. - Before calling
JNI_CreateJavaVM() you need to initialize your vm_args structure with the correct values as described here[^]
It's time for a new signature.
|
|
|
|
|
Dear all,
I need to implement a javascript function that triggers an AJAX refresh request every 2 seconds in JSF page.
thnx
|
|
|
|
|
Did you know java and javascript are different?
And why do you need to refresh using it?
There is a simple and very easy way to refresh a page, irispective of the server implimentation:
<HEAD>
[... stuff ...]
<META HTTP-EQUIV="Refresh" CONTENT = 2>
</HEAD>
<BODY>
[... stuff ...]
</BODY>
Panic, Chaos, Destruction.
My work here is done.
or "Drink. Get drunk. Fall over." - P O'H
|
|
|
|
|
Dear all,
i need to refresh ONLY part of a jsf page using AJAX every 2 seconds
e.g.: facebook notifications
|
|
|
|
|
Did you try searching Google for "jsf ajax"? There are a lot of articles and tutorials showing you how to use AJAX with JSF.
Or there is IceFaces which is a JSF-AJAX library although that may be a bit OTT for you if this is just a very simple requirement.
|
|
|
|
|
This is a Java forum and Javascript is different cup of coffee!
♫ 99 little bugs in the code,
99 bugs in the code
We fix a bug, compile it again
101 little bugs in the code ♫
|
|
|
|