This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Journey To Enterprise Agility and have Daryl Kulak & Hong Li on-line!
See this thread for details.
Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

can i use any jvm supported language in java?  RSS feed

 
Ranch Hand
Posts: 1102
3
  • Mark post as helpful
  • send pies
  • 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: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • 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: 1102
3
  • Mark post as helpful
  • send pies
  • 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: 4702
9
Java Scala
  • Mark post as helpful
  • send pies
  • 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: 1102
3
  • Mark post as helpful
  • send pies
  • 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: 3185
34
Google App Engine Java Ruby
  • Mark post as helpful
  • send pies
  • 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: 4687
117
  • Mark post as helpful
  • send pies
  • 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: 1102
3
  • Mark post as helpful
  • send pies
  • 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: 1102
3
  • Mark post as helpful
  • send pies
  • 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..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!