Compile other languages in a Java program

Hi all,
Is it possible to compile and run other programming languages in a java program?
Thx in advanced!

I suppose it's possible, using [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html]Runtime.getRuntime().exec("gcc ... MyProg.c");

Similar Messages

  • Compile correct but not run java programs

    I have problem. Java program copile correctly but not run. I can't understand this one.
    **this is the error**
    Exception in thread "main" java.lang.NoClassDefFoundError: suminda
    Caused by: java.lang.ClassNotFoundException: suminda
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Could not find the main class: suminda. Program will exit.

    The error is telling you that the jvm could not find a class named suminda. Are you aware that class names are case sensitive? Suminda is not the same as suminda for example.
    This error usually happens when you haven't specified the classpath correctly. A simple thing to try isjava -cp  .  sumindaHere's some links that may help.
    [http://www.kevinboone.com/classpath.html]
    [http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html]

  • To display chinese/japanese language Character filename - Java Programming

    In Our application supports to upload a file with name in chinese/japanese language Character. When user tries to download filedownload dialog box is appearing with the filename as junk characters.
    How to solve this issue to display the filename as uploaded.

    Have your tried googling your problem?
    I found this article: [http://www.chinesecomputing.com/programming/java.html|http://www.chinesecomputing.com/programming/java.html] That seems promising, but ofcourse I cant tell if it will work on your application without seeing a shred of code.
    Im certain there is others that has had the same problem before, and put up their solutions on the net.

  • Can i caprure a streem coming from other site useing a java program

    i am haveing a situation that i have to capture the stream from another site.(site which provide some .mp3 songs with no down load option useing their custom player onley we can here songs)
    can i capture the streem programatically avae it to the hard disk.
    any body have the idea how to do this.
    thanks

    Careful... the Big Brother Err... the RIAA is watching! :) )

  • Java programming training

    does sun offer some sort of java programming training on their website? is there any other website that offers java programming training

    does sun offer some sort of java programming training on their website? is there any other website that offers java programming training

  • Type conversion when calling a java program in form 6i

    Hi,
    I would like to call a java program in form 6i. The java program takes a date parameter in. When I call the java program in form, how can I pass a date parameter to it?
    -- Method: isSystemDate (Ljava/util/Date;)Ljava/lang/String;
    FUNCTION isSystemDate(
    obj ORA_JAVA.JOBJECT,
    a0 ORA_JAVA.JOBJECT) RETURN VARCHAR2;
    Thanks.

    hi Tony,
    Perhaps you could notice that i myself commented in the beginning itself that I know that XE does not support JAVA. I wanted to know if there is any other way of calling java program from apex, perhaps from javascript,etc.
    if you RE READ the comment from Munky , he says that I could use PL/SQL for my objective and I have answered WHY it does not satisfy my problem
    thanks
    Edited by: eric clapton on Nov 14, 2010 9:11 AM

  • How to Set up the  variables and others to compile and Run Java Programs

    Hello,
    I have just downloaded the jdk1.6.0_07 and jre1.6.0_07 and installed it in C:\Program files\Java in my Windows XP ,So please tell me how to sett up the enviroment variables etc to compile and run Java Programs from Command Prompt.
    thanks

    To set the PATH permanently, add the full path of the jdk1.6.0_<version>\bin directory to the PATH variable. Typically this full path looks something like C:\Program Files\Java\jdk1.6.0_<version>\bin. Set the PATH as follows on Microsoft Windows:
    1. Click Start > Control Panel > System on Windows XP or Start > Settings > Control Panel > System on Windows 2000.
    2. Click Advanced > Environment Variables.
    3. Add the location of bin folder of JDK installation for PATH in User Variables and System Variables. A typical value for PATH is:
    C:\Program Files\Java\jdk1.6.0_<version>\bin

  • Compiling Java program from other java program

    Hi,
    How can I compile and capture the compilation result from another java program?
    Thanks

    As if I had seen somewhere a hint about being able to
    programatically compile with the help of the class
    sun/tools/javac/Main found in the tools.jar.I saw that article, too, but when I took a look at the JDK's source code, it became apparent that none of the classes in tools.jar are supported. Your program could break with any new version of the JDK.
    If you're still interested, here's the URL:
    http://java.sun.com/developer/JDCTechTips/2003/tt0722.html

  • Cannot compile java Programs

    hi everyone,
    when i tried to compile a java Program i had created.I got the following Error.
    Error occoured during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
    I reinstalled the entire thing from the system and when i tried to compile the java Program again it gives like a 1000 errors even on the programs i know that work fine and even the very basic 5 or 10 line Programs.Can someone tell me what is happening??

    Having Deleted a file in the folder that i was executing the javac seem to have fixed the problem.It was called String.java
    and the content of the file were as mentioned under:Any help on why it happened or what the file was doing would be really appreciated.
    The content of the file:-
    ""Java String Examples
    The String class implements immutable character strings, which are read-only once the string object has been created and initialized. All string literals in Java programs, are implemented as instances of String class.
    The easiest way to create a Java String object is using a string literal:
    1.
    String str1 = "I can't be changed once created!";
    A Java string literal is a reference to a String object. Since a String literal is a reference, it can be manipulated like any other String reference. i.e. it can be used to invoke methods of String class.
    For example,
    1.
    int myLenght = "Hello world".length();
    The Java language provides special support for the string concatenation operator (+), which has been overloaded for Java Strings objects. String concatenation is implemented through the StringBuffer class and its append method.
    For example,
    1.
    String finalString = "Hello" + "World";
    Would be executed as
    1.
    String finalString = new StringBuffer().append("Hello").append("World").toString();
    The Java compiler optimizes handling of string literals. Only one String object is shared by all strings having same character sequence. Such strings are said to be interned, meaning that they share a unique String object. The Java String class maintains a private pool where such strings are interned.
    For example,
    1.
    String str1="Hello";
    2.
    String str2="Hello";
    3.
    If(str1 == str2)
    4.
    System.out.println("Equal");
    Would print Equal when executed.
    Since the Java String objects are immutable, any operation performed on one String reference will never have any effect on other references denoting the same object.
    String Constructors
    String class provides various types of constructors to create String objects. Some of them are,
    String()
    Creates a new String object whose content is empty i.e. "".
    String(String s)
    Creates a new String object whose content is same as the String object passed as an argument.
    Note: Invoking String constructor creates a new string object, means it does not intern the String. Interned String object reference can be obtained by using intern() method of the String class.
    String also provides constructors that take byte and char array as an argument and returns String object.
    String equality - Compare Java String
    String class overrides the equals() method of the Object class. It compares the content of the two string object and returns the boolean value accordingly.
    For example,
    1.
    String str1="Hello";
    2.
    String str2="Hello";
    3.
    String str3=new String("Hello") //Using constructor.
    4.
    5.
    If(str1 == str2)
    6.
    System.out.println("Equal 1");
    7.
    Else
    8.
    System.out.println("Not Equal 1");
    9.
    10.
    If(str1 == str3)
    11.
    System.out.println("Equal 2");
    12.
    Else
    13.
    System.out.println("I am constructed using constructor, hence not interned");
    14.
    15.
    If( str1.equals(str3) )
    16.
    System.out.println("Equal 3");
    17.
    Else
    18.
    System.out.println("Not Equal 3");
    The output would be,
    Equal 1
    Not Equal 2
    Equal 3
    Note that == compares the references not the actual contents of the String object; Where as equals method compares actual contents of two String objects.
    String class also provides another method equalsIgnoreCase() which ignores the case of contents while comparing.
    Apart from these methods String class also provides compareTo methods.
    int compareTo(String str2)
    This method compares two Strings and returns an int value. It returns
    - value 0, if this string is equal to the string argument
    - a value less than 0, if this string is less than the string argument
    - a value greater than 0, if this string is greater than the string argument
    int compareTo(Object object)
    This method behaves exactly like the first method if the argument object is actually a String object; otherwise, it throws a ClassCastException."""
    Edited by: Gold_y on Oct 30, 2009 4:59 AM

  • Running a java program in a directory other than the current directory

    How do I run a java program that's located in a directory other than the current directory?
    There is a file Test.java in /dir1/subdir1. If my current directory is anywhere other than that directory, say /dir2/subdir2, I can compile Test.java by using:
    javac -classpath /dir1/subdir1 /dir1/subdir1/Test.java
    But when I try to run it with:
    java -classpath /dir1/subdir1 /dir1/subdir1/Test
    I get a java.lang.NoClassDefFoundError: \dir1\subdir1\Test
    Any thoughts?

    You need to specify just the name of the class you want to run. So java -classpath /dir1/subdir1 Test

  • How to run a java program without Java Compiler

    I have a small project and I want share it with my friends but my friend'pc have not
    Java compiler.
    for example, I writen a application like YM, then 2cp can sent,receive messege. My cumputer run as Server, and my frien PC run as client.
    How can my friend run it? or how to create an icon in dektop tu run a java program..??..
    (sorry about my English but U still understand what i mean (:-:)) )

    To run a program you don't need a Java compiler. Just the Java Runtime Engine. That can be downloaded from the Sun website and comes with an installer.
    You could then turn your application into an executable jar file and start it somehow like jar myYM.
    There is also software that packs a Java program into an executable file. I've never used that but one that comes to my mind is JexePack. It's for free if you can live with a copyright message popping up every time you start the program.
    http://www.duckware.com/jexepack/index.html

  • Not able to compile java program

    Hi
       I a using Netweaver to deelope the java code.I have written a javaprogram .But when choose the option Run as
    a javaApplication it giving the following error
    Source locator  doesnot Exist:org.eclipse.jdt.debug.ui.javaSourceLocator

    Hi,
    I am able to compile and run perfectly Java programs. The steps goes as:
    1. File --> New --> Project --> Java --> Java Project --> give a <project name> --> Finish
    2. File --> New --> Class --> give a classname, and package name.
    3. Put main method and give a System.out.println("Hello");
    Source code:
    package com.i3l.trg;
    public class HelloWorld {
         public static void main(String[] args)      {
              System.out.println("Hello");          
    4.Goto Run --> Run As --> 2 Java Application.
    5. You will get a output as "Hello" in java console.
    Cheers!!!
    Sukanta Rudra
    PS: Liberally donate points.
    The full source code is

  • How to excute a program written in other language?

    How to pass some parameters to other excutable program written in other languages and to get the return value back?

    http://java.sun.com/j2se/1.3/docs/api/java/lang/Runtime.html

  • Compiling and running Java programs on my laptop

    I have just bought a new laptop but I can't run and compile Java programs using the javac filename.java command in the command prompt. I know I have to download something but I am not sure what link. I would be grateful if somebody could send me on a URL. My O/S is Windows XP. Can somebody advise please?

    If you just want to run java applications, you just need the JRE: J2SE 5.0 JRE
    If you want to compile java source code, you need the JDK: J2SE 5.0 JDK
    It includes also the JRE. Recommended is also the J2SE 5.0 Documentation that contains the javadoc API that describes all the Java classes.
    To start develeoping I recommend the Java Tutorial: http://java.sun.com/docs/books/tutorial/

  • Programming in other languages?

    Are programming languages available in any other language aside from English or are terms such as public/private/double/abstract etc etc used in every country?

    ps. I once had to work with a French Algol/60 compiler where all
    the 'keywords' were translated in French ... shudder
    Sometimes, for no particular reason, when I get an Exception, I say the word
    Exception with an Italien accent, "Hey, I justa gotta an Excep-sion-ay"Do you do the gestures and the handwaving too? I'm quite good at that: "Hey,
    no-one-a eez-a givink me an Exception-ay just-a like-a dat-ay? I'm a
    sensitive-a human-da beink! You break-a my heart, I break-a your leg".
    kind-a regards and say hello to da fish from me,
    Capo di tuti Capi Jos

Maybe you are looking for

  • XML/XSLT problem

    I'm currently reading info on using XSLT with XML documents ("Java Server Programming" by WROX), but I'm having quite a few problems getting anything to work. Can someone point me to a page/document that simply explains what .jar files to install, wh

  • Errors in PDA with MAM25

    Hi all I am working On a PDA with Operating System:  Windows Mobile 2003 SecondEdition , vertion :4.21 JVM vertion :CrEme327_AX_CE42_PPC_minimal.CAB I Added new fields in the Notification Create Screen of  the Front end  every thing worked fine In la

  • S10-3 battery upgrade for more than 4.4 Ah capacity

    Hey, Can I upgrade to a battery with more capacity than I do have (4.4 Ah) on my ideapad S10-3 model 0647? Battery model is 121000930. And if i can, so which model of battery should i choose?

  • Upload hebrew language texts in customer master

    Hi, how can we upload hebrew language texts (HEBREW langauge symbols) in customer master please let me know Thanks in Advance

  • How can I get back one of my registrations?

    My iMac recently needed a new operating system and hard drive. Unfortunately my Creative Suite was deleted. I was wondering if there is a way I can get back one of my registrations.