aspose file tools
The moose likes Java in General and the fly likes using dll in java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "using dll in java" Watch "using dll in java" New topic
Author

using dll in java

aroua rourou
Greenhorn

Joined: Mar 08, 2012
Posts: 26
how to insert a dll in java which contains several methods
dll and it is even a source code ?


i want to use lame-3.99.5 TO encode MP3 ??
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1295

Few questions:

1) If you want to encode mp3 using lame, then why do you need a Java program?
2) Even if you write a Java program, why do you want to call functions from dll? You can directly call lame executable from Java.

Yes, you can use JNI APIs and call functions from dll in Java code, but then, it will lose its platform independence which is unnecessary. In my opinion, use JNI only when you really need to. The task you want to achieve can be simply done by a small script (bat or shell etc.)


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD)
aroua rourou
Greenhorn

Joined: Mar 08, 2012
Posts: 26
MP3 encoding is part of my program in java, i want to convert wave file to mp3 file
puique but I am beginner in java I did not know how to call lame executable from Java
I also thought of using JNI API but here I am blocked here
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32830
    
    4
Not a “beginning” topic. Moving.
Martin Vajsar
Bartender

Joined: Aug 22, 2010
Posts: 2380
    
    3

This article summarizes what you need to do to run an external process. Try to read it, possibly use the provided examples as a template and adapt it to your needs. If you get stuck, let us know, somebody here should be able to help.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: using dll in java
 
Similar Threads
creating a dll out of a java class
how to run dll using java
how to use DLL in java code
Calling a generic DLL
Jni problem