• 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

can i use any jvm supported language in java?

 
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello all,
although there are many languages which are supported by jvm (ie, scala, groovy etc.).
i just want to know, can i easily use groovy or scala or any one which is supported by jvm in my java code??
 
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Punit Jain wrote:hello all,
although there are many languages which are supported by jvm (ie, scala, groovy etc.).
i just want to know, can i easily use groovy or scala or any one which is supported by jvm in my java code??


Yes you can. You need to add the Language specific Jar to your classpath and your are good to go. Even Clojure APIs can be used in Java.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
okay, so means, suppose if scala is good in some features (i haven't use so don't know in which), so while writing my java code, for that feature(in which scala is good) can i use scala for that only??
is it good to use different-2 languages for a single project ??
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i don't know about good, but people do it. using JNI(i think it is) you can run C or C++ code from a java app
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


i don't know about good, but people do it. using JNI(i think it is) you can run C or C++ code from a java app



well i think jni support is not required for jvm languages, i provides native support if i am not wrong.
 
Mohamed Sanaulla
Bartender
Posts: 3225
34
IntelliJ IDE Oracle Spring Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could make use of the APIs of the JVM languages once you have them on your application class path. I remember the other day using JsonSlurper class from Groovy to parse the JSON documents in Java.
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Punit Jain wrote:well i think jni support is not required for jvm languages, i provides native support if i am not wrong.


What Randall means is that JNI allows you to use C and C++ code in conjunction with Java if that's what you want/need to do.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


You could make use of the APIs of the JVM languages once you have them on your application class path. I remember the other day using JsonSlurper class from Groovy to parse the JSON documents in Java.


okay..
thank you Mohamed Sanaulla..
also is it good to use different-2 languages for a single project ??
i mean better then using one only??
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


What Randall means is that JNI allows you to use C and C++ code in conjunction with Java if that's what you want/need to do.


ohh sorry for misinterpret..
reply
    Bookmark Topic Watch Topic
  • New Topic