This project has moved and is read-only. For the latest updates, please go here.

Java Issue


Apologies as I am sure this is a stupid question.

I'm trying to build the Java version of the emulator and the examples have references to what looks like the main package: import com.bemu.BEmu.*;

but I can't seem to find that code anywhere.

I am looking at the BEmuJava project


Robinson664 wrote Jun 19, 2014 at 6:48 PM

I think you are talking about the files in the folder /BEmuJava/bemu/src/main/java/com/examples/... including this one.

This is a mistake on my part. I originally included the Java examples files in the BEmuJava project for my own testing. I then moved those files into their own project called BEmu_Java_Examples. I did this to mirror how a developer would reference the actual BB API. It looks like I forgot to remove the example files from the BEmuJava project, and this led to your confusion and probably other users' confusion.

I will remove those files and commit the source code. In the meantime, please ignore those files and use the example Java files in the BEmu_Java_Examples project BEmu_Java_Examples/com/com/examples including this one. You'll notice that these files import the com.bloomberglp.blpapi.... namespaces.

Note that another reason this problem is happening is because I changed the namespace of my project from com.bemu.BEmu....; to com.bloomberglp.blpapi.... in order to match the namespaces of the actual BB API.

Thank you for pointing out this problem. It is not a stupid question.

svimma23 wrote Jun 19, 2014 at 9:48 PM

Thanks for the quick response - I did figure out to use the Java_Examples project eventually.

I am still a little confused about which classes are in the actual bloomberg api versus your emulator. Within bemu.jar, there is the package which seems to have the actual BBG API? And your emulator files are in com.bloomberglp.blpapi within bemu.jar? And the rest of the classes: aren't needed?

Also - under the new namespace, how do I switch back and forth between emulator and real BBG API?

And last thing: is it possible to put the raw emulator java files (not just the class files in a .jar) so I can modify them? I'd like to change the time series to not be quite random outputs but to look somewhat like asset prices (auto correlated) and also to make options prices valid (above intrinsic)

Robinson664 wrote Jun 20, 2014 at 4:40 PM

First question: I did not mean to include the blpapiXXX.jar file in the download. I also looked through the Java folders some more and realized that I should make some changes. Here's what I did to try to make this less confusing:
  • Now the only files inside the BEmuJava/bemu/src folder are *.java files.
  • I put the BEmu.jar file in BEmuJava/bemu/output file instead somewhere in the BEmu_Java_Examples project.
  • The BEmu_Java_Examples/com folder now contains only the *.java files
  • The BEmu_Java_Examples/output folder contains only the *.jar files needed to run the example files and nothing else.
  • I removed a lot of files that were cluttering up the directories.
  • I renamed the BEmu_Java_Examples run configuration to Run_BEmu_Examples for clarity.
I committed all of this to the CodePlex project, so you can check out for the latest files. I will soon upload a new installer for the Downloads tab.

Second question: The way to switch between the the BB API and the BEmu API is to change your project references. Both use the same namespace: com.bloomberglp.blpapi. To use the BEmu API, reference the BEmu.jar file. To use the BB API, reference the blpapiCCC.jar file which you can download from

Originally, I asked that users simply change the namespaces that they import: from com.examples.bemu to com.bloomberglp.blpapi. Another user pointed out that it is easier to use the same namespace and simply update the project references. This is helpful, especially if the user has a lot of files that import these namespaces.

Third question: You can download the raw emulator java files (the source code) from the Source Code tab on this page ( My code is open source. For changing the data stream, you might be able to do this easily by updating the RandomDataGenerator code. I haven't given this too much thought though.

Let me know how this works for you.

svimma23 wrote Jun 20, 2014 at 4:49 PM

Great thank you - looking at it now. Will let you know if there are any further issues, but it looks a lot less confusing now.