Is every code based on Oracle working with OpenJDK? - java

I would like to know, how can I find the main differences between OracleJDK and OpenJDK. I still don´t get the whole difference between them if it comes to coding?
It is a university question, where I have to describe and evaluate, if the codes, which are shown in our lecture notes are capable of running when using OpenJDK.
In our lecture we are currently using Java JDK 8u112.
Topics in the lecture are for example: BufferedReader/Writer, FileReader, InputStream, ArrayList, Abstract class, Interfaces, JavaFX , JAvaFX for 2D, ...
Do you have an idea, how I can find out if the codes are working, without testing all of them on OpenJDK or without downloading and installing OpenJDK?
The only thing I found out yet is that there might be a difference in OpenJFX, and also in rastering.
Thank you very much.

Related

Starting up an Intel SGX Enclave from a Java application

Good evening, and thanks to everyone in advance.
I am currently working on My MsC Thesis, and for the proposed solution so far, I am to use an existing Java application (BFT-SMART, built with gradle version 7.3.3) and add it a layer of confidentiality using Intel SGX, with the objective of each replica containing its own Intel SGX enclave.
My problem however, is not being able to start an enclave from a Java application other than a given example.
The given example was all I found, and after some changes to its make File, I was able to successfully execute this simple Java application in Simulation Mode.
https://github.com/lishen-nt/sgx-language-adapter/
However, how do I adapt this to something different? The given code:
static {
System.loadLibrary("Sgx");
}
/* Initialize the enclave */
public native int jni_initialize_enclave();
Seems to only work with this given example, not working with other tests that I have personally been trying, with the project being unable to find said library. Is there a way to add Make File statements to a gradle build in order to link Intel SGX Libraries to the project?
Before considering adding Intel SGX to the aforementioned project, I was trying to build my own sample project to base myself off of, any tips on this?
I do apologize for the extremely ambiguous and open-ended question, I am just at a complete loss of where to begin looking for options or examples I could base myself off of.
Thanks for everyone's help!
Rather than trying this old alternative (updated 4 years ago), I would try something newer, such as Scone or SGX-LKL. I think it would be easier to get some help and get success with your project.

LLVM emulation in java library?

Just wondering out of curiosity, if one exists ?
I found a project called java-lli on GoogleCode that seems to be trying to do this. It is not clear how much progress has been made though. (No downloadable artefacts, and nothing in the Wiki. Just stuff in SVN with the last commits in May 2011.)
FWIW, you get more results if you search for "interpreter" rather than "emulator".
Just for further information, David A. Roberts put together LLJVM (#Github). This project is also for executing LLVM-derived bitcode on the Java JVM.
Please refer to my SO answer regarding this, as some other community members had furthered his code/created patches.
[Update] - LLJVM has seemed to have been dead for somewhile, however Howard Chu (https://github.com/hyc) looks to have made LLJVM compatible with the latest version of LLVM (3.3). See Howard's LLJVM-LLVM3.3 branch at Github, here

What happened to Java Media Components?

After researching my options with regards to video support in Java, I stumbled across Java Media Components mentioned a few times, along with this article that seems to hint they hoped to include it in Java 7.
This originally looked great, so I set about finding it in Java 7 with the hope of including video support pretty easily. Needless to say I couldn't find it, and after Googling around all I can really find are half baked references to crow-barring part of the thing out of JavaFX.
So does anyone know what happened to it? Was it dropped along with lots of other features for Java 7 and pushed back to Java 8? Or dropped entirely? Or is it now just been integrated into JavaFX? The latter would make most sense to me, but the latest JavaFX release just claims to support FLV (at least at the moment) whereas the references I can find to JMC seem to point to it supporting a whole host of formats.
Long question short, does anyone know what's going on?
Its still there, but pretty much ignored. Much of the UI aspects in Java have moved over to JavaFX, not sure how it might be with Video though.
In reference to your question, here's a link to the current page on Oracles site. I believe it was always a separate download and still is.
hth.

Java in Visual Studio 2010?

Is there any way to manage/debug/compile Java projects in Visual Studio 2010?
Before you answer, please read this topic.
I'm a little late to the party, but it looks like someone has started adding support. From the description, right now it only does syntax highlighting and basic navigation within a single file. However, in the Q&A section the author mentions plans to add compilation and debugging support later in the year.
The short answer - No.
The long answer - No, because the supposed intellisense support for Java that the blog entry referred to, in the question, relies on J# support. I believe it has been quite sometime since Microsoft has discontinued J# - VS2008 does not have it.
In the long run, you're better off learning how to use Eclipse/Netbeans/IntelliJ IDEA or any other IDE for the purpose of managing Java projects.
Sure. Visual Studio works with any language so long as someone takes the time to write the plug-ins for it. Heck, Mainsoft has already added JVM debugging support to Visual Studio. They just don't support the language.
The only problem is YOU are going to have to be the one who writes it.
I won't lie to you. It won't be easy and fan-boys on both sides will hate you for it. But if you pull it off I can at least offer you some money to write about how you did it.
No, although, I long for the day when VS might possibly support building Java applications. I don't think I have yet found an IDE as fully featured. Personally, if VS supported Java development, then I would trash my installation of Eclipse and Netbeans. ... so tired of wonky Java IDEs....
Cyberduck is written in Java and developed in Visual Studio 2010, though it requires IKVM, an implementation of Java for Mono and the Microsoft .NET Framework. Here are the build instructions.
C++ syntax highlighting looks pretty good for Java. Turn this on in Options->Text Editor->File Extension.
Extension: java
Editor: Microsoft Visual C++
Now reopen a .java file and see pretty colors.
I will advise to go for Eclipse, if you have to do at least 25% Java coding. Otherwise VS is good as well. But I like Eclipse for C++ as well as Java.
A new plugin is currently being developed named IntegraStudio,
aiming at full Java development under VS. It currently supports:
IntelliSense for Java (comparable to standard C++ IntelliSense in VS)
build with Ant or Maven
direct Ant / Maven project view in Solution Explorer
Java debugger with container visualization
support for VS browsing features (Class View, Code definition, etc.)
Class View works also for classes in JARs (including standard library)
browsing Maven repositories
JDK: 1.6 - 1.8
It uses standard JDK tools and targets the real Java platform (it
is not a .NET platform solution, as VJ# was).
At the moment of writing this, the IntegraStudio plugin is beta.
It does not yet contain advanced Eclipse features, however many
of them are in current roadmap (e.g. code refactorings and quick fixes).
You can find it on Visual Studio gallery:
http://visualstudiogallery.msdn.microsoft.com/588fb167-d18c-4e61-8aeb-30baeddb00da
The product official website is:
http://www.softerg.com/integra
Current docs (with large number of screenshots):
http://www.softerg.com/integra/docs/pages/is_intro.htm

Accessing .NET/dll libraries/components from Java?

Are there inexpensive or free gateways from .NET to Java? I'm looking at some data acquisition hardware which has drivers for C/C++ and .NET -- I really don't want to do any programming in .NET.
Update: I haven't done what I originally wanted to do, but I've done something similar, using JNA to encapsulate some functions from a DLL, in order to control a USB hardware device from Java. (the DLL comes from the device manufacturer) It works really nicely. Thanks!
You could also try to use JNA for accessing the native library. JNA provides Java programs easy access to native shared libraries (DLLs on Windows) without writing anything but Java code—no JNI or native code is required. If their API is fairly straight foward, this might be the path of least resistance.
See their getting started guide where they call some native code (printf and GetSystemTime).
Well, there's JNBridge and EZ JCom, just from a Google search.
You could also use IKVM which is a slightly different approach.
(Any reason for not wanting to learn .NET, out of interest? It's a nice platform, and C# is a lovely language...)
If they have C++ versions of the drivers then you could write a wrapper around it using JNI and then load that in Java. JNI can be a bit of a pain, but it would let you use the C++ version of their drivers and not have to deal with .Net at all if you don't want.
I am partial to the recommendation to jump in the deep end with C# since it is so similar to Java. I did this and used IKVM to compile my favorite Java libs. to .NET assemblies and you get [nearly] all the core java runtime classes to boot, so if you tire of trying to find just the right C# collection type, you can always go back to java.util. (No generic collections though. Not sure why.)
Depending on what platform you're on, you have several choices for free IDEs too. For windows you can get Visual Studio Express for free but I also use SharpDevelop. You can also get the Mono IDE on Linux (and a few flavours of Unix, I think ?).
The C# learning curve is shallow if you already know Java. I only blew off 1.5 limbs on landmines that came out of nowhere for reasons I still don't understand, but workarounds were easy to come by. The worst thing about it was the darn developer docs which are AWFUL on account of being so slow. I really miss the snappiness of JavaDoc. Not only are the online docs incredibly slow, the problem is compounded by someones's iffy decision to put class summaries, constructors and methods/properties all on seperate pages so it just takes forever. Someone said to get the docs installer and install docs locally for a slightly improved experience. Not a bad idea I suppose.
I am author of jni4net, open source interprocess bridge between JVM and CLR. It's build on top of JNI and PInvoke. No C/C++ code needed. I hope it will help you.
If you have a Java application, the JNI mentioned by the others will be the way to go. You write some wrapper classes, and that's it.
If writing the wrappes is a too big task (depending on the number of methods you have to wrap), have a look at SWIG . I think it generates wrappers automatically, but I never actually used it.
If you want to code in the Java language, but you don't care if your program will run on the JRE/JVM, then you might as well use Microsoft J#. Basically, it's writing Java-Code wich is compiled to .NET-Bytecode and can use the .NET classes of the driver as well as your existing Java classes. With J# you will run into problems if your existing Java-code is newer than Java 1.4, look at this question on how to solve them.
From that point on, you could later add code in J#, C# or any other .NET language. However, you won't get back to the JRE/JVM easily.

Categories

Resources