• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java and other languages

 
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello.

this is my first post here and i hope someone can help me. :-)

anyway, i've just been starting with java and i'd like to know if java can connect to other applications in other languages. like connect to an executable in c to launch it. or something like that? or even connect to something like sas?
 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Yes Offcourse. java has a functinality to connect with other languages.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And it is called JNI.
 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
so i can just click a button in my application, both in standalone and web, and it can launch another program?

i'll read the link you gave. thanks a lot.

can you give me an overview though so i would have a basic idea of it?
how can i set that up?
 
Chidanand Chauhan
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shuini gustav:
so i can just click a button in my application, both in standalone and web, and it can launch another program?

i'll read the link you gave. thanks a lot.

can you give me an overview though so i would have a basic idea of it?
how can i set that up?



Hi
I think in the above post Paul has given the link that is too much if you are a new in Java.

Cheers
Chidanand Chauhan
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by shuini gustav:
so i can just click a button in my application, both in standalone and web, and it can launch another program?



If that's the only thing you want to do, you don't need JNI. You can use one of the exec() methods of class java.lang.Runtime to start other programs. Look it up in the API documentation.
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


so i can just click a button in my application, both in standalone and web, and it can launch another program?

i'll read the link you gave. thanks a lot.


To call a native method you need JNI. What I mean by the is if you have written a method in C you can't to call through Java, you'll have to use JNI. however, if you have a seperate application you wan't to run from a java process that is easier. You have exec() methods in the java.lang.Runtime class which can execute a seperate process. Doing this from a web application however is probably a bad idea, unless you have a specific need to let clients start processes on your server?
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are you trying to do and why? What is your goal? It's not typical for new students of Java to immediately try to get out of Java!
 
Bernard Sigmund Gustav
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm trying to make a launcher in java.
but the thing is, the applications that i will be integrating and putting into my launcher are done in c or visual basic.

basically, if the users already have these separate applications installed on their system, then my launcher would just find the exe file and execute it. if the users don't have it installed, then java installs it(applications in vb or c) on their system.

i'll try to look at the java runtime thing. thanks
 
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There have been others who have tried to write a launcher and have discussed it in other threads earlier at the ranch. You might want to peruse these threads.

You can use the Search feature and dig up these threads.
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic