Results 1 to 7 of 7
  1. #1
    pennaverde is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Convert jar to dll

    Hi, i post this message for ask just a little question. For those who don't know(I'm presented in the special section) I'm a producer of video games and I working with Java and C# in a program named Unity 3D. what I wonder is i need convert jar class to dll. I try to convert it by ikvm, and i try to follow
    documentation but i get only errors. Can you show me how can i doing about the step.(sorry for my eng)
    Thanks in advance :D

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Convert jar to dll

    Your best bet is to use JNI or JNA to allow Java to communicate with a dll (if this is necessary).

  3. #3
    pennaverde is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Re: Convert jar to dll

    can you be more detailed pls? thx a lot :)

  4. #4
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,267
    Rep Power
    25

    Default Re: Convert jar to dll

    Can you describe the functionality that the code in the jar file provides?
    A jar file is is a container of .class files and other resources much the same as a zip file. The java command knows how to retrieve class files from jar files when it needs them for execution.
    To execute a class file requires a JVM.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Convert jar to dll

    Quote Originally Posted by pennaverde View Post
    can you be more detailed pls? thx a lot :)
    Actually, I was going to ask you the same. I assume that you want your jar to be in a dll to allow it communicate more easily with a C# program (but I'm just guessing since you don't say). Java Jars are not easily "put into a dll". Much easier would be to allow communication via sockets, or failing that creating a C bridge program and use JNI or JNA (easy to look up) to allow the C program to interact directly with Java.

  6. #6
    pennaverde is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

    Default Re: Convert jar to dll

    I want to create a speech recognition app, and i want move the code of main class in new function(inside java), then(after converting the file in dll and import in c# prjct) call that function from c# code

    this is the code hello world to edit
    what do you think? it's possible?(obviusly i don't have change yet)

    Java Code:
    package edu.cmu.sphinx.demo.helloworld;
    
    import edu.cmu.sphinx.frontend.util.Microphone;
    import edu.cmu.sphinx.recognizer.Recognizer;
    import edu.cmu.sphinx.result.Result;
    import edu.cmu.sphinx.util.props.ConfigurationManager;
    
    /**
     * A simple HelloWorld demo showing a simple speech application built using Sphinx-4. This application uses the Sphinx-4
     * endpointer, which automatically segments incoming audio into utterances and silences.
     */
    public class HelloWorld {
    	public static String whatTalk;
    	public static Boolean isRecognize = false;
        public static void main(String[] args) {
        	
            ConfigurationManager cm;
    
            if (args.length > 0) {
                cm = new ConfigurationManager(args[0]);
            } else {
                cm = new ConfigurationManager(HelloWorld.class.getResource("helloworld.config.xml"));
            }
    
            Recognizer recognizer = (Recognizer) cm.lookup("recognizer");
            recognizer.allocate();
    
            // start the microphone or exit if the programm if this is not possible
            Microphone microphone = (Microphone) cm.lookup("microphone");
            if (!microphone.startRecording()) {
                System.out.println("Cannot start microphone.");
                recognizer.deallocate();
                System.exit(1);
            }
    
            System.out.println("Say: (fire ball | hello | hi | good bye | bye)");
    
            // loop the recognition until the programm exits.
            while (true) {
                System.out.println("Start speaking. Press Ctrl-C to quit.\n");
    
                Result result = recognizer.recognize();
    
                if (result != null) {
                    String resultText = result.getBestFinalResultNoFiller();
                    whatTalk = resultText;              //assign what i've talking at string var
                    isRecognize = true;                  //tells the C # code that I'm talking
                    System.out.println("You said: " + resultText + '\n');
                    isRecognize = false;                 //end of tell
                } else {
                    System.out.println("I can't hear what you said.\n");
                }
            }
        }
    }

  7. #7
    pennaverde is offline Member
    Join Date
    Jan 2012
    Posts
    5
    Rep Power
    0

Similar Threads

  1. IP convert
    By vannam28071988 in forum Networking
    Replies: 1
    Last Post: 09-23-2011, 08:08 PM
  2. cannot convert from int to int[][]
    By besweeet in forum New To Java
    Replies: 9
    Last Post: 04-18-2010, 03:36 AM
  3. Convert to Int
    By 6kyAngel in forum Java Tip
    Replies: 0
    Last Post: 03-06-2009, 09:18 AM
  4. how to convert xml to xsd
    By adi in forum XML
    Replies: 2
    Last Post: 02-12-2009, 02:43 PM
  5. need the help to convert to and from UTF-8 and UCS-2
    By sachin_n in forum Advanced Java
    Replies: 1
    Last Post: 01-05-2009, 09:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •