473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

javascript to execute java program

I have compile my java program as myjava.class. And I can run as "java
myjava" without any program.
As now, I need to execute myjava.class in javascript. Please shed a
light how to execut "java myjava" in
my javascript. Thanks a million.
Sep 29 '08 #1
6 6833
Javascripts runs in the browser you won't be able to do that. You
can't call programs in the server on in the client computer from
javascript.
Sep 29 '08 #2
Sister Ray wrote:
Javascripts runs in the browser you won't be able to do that. You
can't call programs in the server on in the client computer from
javascript.
Utter nonsense.

1. Neither programming language, including ECMAScript implementations
like JavaScript, is restricted to the client or the server.

2. If the Java program is an applet, LiveConnect/XPConnect can be used
to access it from JavaScript.

3. If the Java program is a servlet, a HTTP request can trigger it.
HTTP requests can be initiated with JavaScript using an
external API (e.g., DOM or XHR).
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Sep 29 '08 #3
On Sep 29, 3:41*pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
Sister Ray wrote:
Javascripts runs in the browser you won't be able to do that. You
can't call programs in the server on in the client computer from
javascript.

Utter nonsense.

1. Neither programming language, including ECMAScript implementations
* *like JavaScript, is restricted to the client or the server.

2. If the Java program is an applet, LiveConnect/XPConnect can be used
* *to access it from JavaScript.

3. If the Java program is a servlet, a HTTP request can trigger it.
* *HTTP requests can be initiated with JavaScript using an
* *external API (e.g., DOM or XHR).

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
* -- Richard Cornford, cljs, <f806at$ail$1$8300d...@news.demon.co.uk>
would you please give me some example how to execute the myjava.class
via javascript.
I have tried so many differnt, it doesn't seem working.
Thanks so much.
Sep 29 '08 #4
moongeegee wrote:
Thomas 'PointedEars' Lahn wrote:
>1. Neither programming language, including ECMAScript implementations
like JavaScript, is restricted to the client or the server.

2. If the Java program is an applet, LiveConnect/XPConnect can be used
to access it from JavaScript.

3. If the Java program is a servlet, a HTTP request can trigger it.
HTTP requests can be initiated with JavaScript using an
external API (e.g., DOM or XHR).
[snipped quoted signature]

would you please give me some example how to execute the myjava.class
via javascript.
That depends on where it runs and what the type of program it is.
I have tried so many differnt, it doesn't seem working.
<http://jibbering.com/faq/#FAQ2_3>
Thanks so much.
You are welcome.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Sep 30 '08 #5
On Sep 30, 2:32*am, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
moongeegee wrote:
Thomas 'PointedEars' Lahn wrote:
1. Neither programming language, including ECMAScript implementations
* *like JavaScript, is restricted to the client or the server.
2. If the Java program is an applet, LiveConnect/XPConnect can be used
* *to access it from JavaScript.
3. If the Java program is a servlet, a HTTP request can trigger it.
* *HTTP requests can be initiated with JavaScript using an
* *external API (e.g., DOM or XHR).
[snipped quoted signature]
would you please give me some example how to execute the myjava.class
via javascript.

That depends on where it runs and what the type of program it is.
I have tried so many differnt, it doesn't seem working.

<http://jibbering.com/faq/#FAQ2_3>
Thanks so much.

You are welcome.

PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
* * navigator.userAgent.indexOf('MSIE 5') != -1
* * && navigator.userAgent.indexOf('Mac') != -1
) *// Plone, register_function.js:16
If he's executing the program via the java command, then it's actually
some sort of either desktop or headless application, and neither a
servlet nor an applet. The other question remains "Where does this
application lie?". Is it on the server or the client?

If it's on the client, then I know of no way to execute a java
application via javascript. For you gurus out there who want to chime
in, it would be just like running any other application installed on
the client pc....

If the java application is on the server, then you will have to write
a servlet that executes the java application, and have the javascript
call the servlet to ask it to do so.
Sep 30 '08 #6
Tom Cole wrote:
Thomas 'PointedEars' Lahn wrote:
>moongeegee wrote:
>>Thomas 'PointedEars' Lahn wrote:
1. Neither programming language, including ECMAScript implementations
like JavaScript, is restricted to the client or the server.
2. If the Java program is an applet, LiveConnect/XPConnect can be used
to access it from JavaScript.
3. If the Java program is a servlet, a HTTP request can trigger it.
HTTP requests can be initiated with JavaScript using an
external API (e.g., DOM or XHR).
[snipped quoted signature]
would you please give me some example how to execute the myjava.class
via javascript.
That depends on where it runs and what the type of program it is.
>>I have tried so many differnt, it doesn't seem working.
<http://jibbering.com/faq/#FAQ2_3>
[...]

If he's executing the program via the java command, then it's actually
some sort of either desktop or headless application, and neither a
servlet nor an applet.
ACK, I overlooked the second sentence, probably due bad writing.
The other question remains "Where does this
application lie?". Is it on the server or the client?

If it's on the client, then I know of no way to execute a java
application via javascript. For you gurus out there who want to chime
in, it would be just like running any other application installed on
the client pc....
There is a way, just not an interoperable one.
If the java application is on the server, then you will have to write
a servlet that executes the java application, and have the javascript
call the servlet to ask it to do so.
Correct if you mean "HTTP request" by "call" (why are you reiterating what
was just said?). Another possibility that comes to mind are XML-RPCs.

Please trim your quotes as recommended in the FAQ (see above).
PointedEars
--
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
-- from <http://www.vortex-webdesign.com/help/hidesource.htm>
Sep 30 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: MStepansky | last post by:
Whats the difference between Javascript and Java3D? I mean can Javascript do like Java3D can? Or is Java3D on top of Javascript (the core, if thats what it is)? Then I should learn Javascript...
7
by: google | last post by:
I would like to execute a single JavaScript command from within a web service. The command is a mathmatical statement. I have a web page with some client side logic that does this and I'm now...
5
by: sayeo87 | last post by:
Hi, I am quite new to JSP so please forgive me if I ask really simple things... I am trying to run system commands on the server and display the output on a webpage. This is what I've got: <%@...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.