Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tilengine on Java
#51
Alright!

But yeah, Java isn't good for that :/
Also, I'm using Java 8 for my project.

And it's me or implementing C DLLs is much easier on C# than Java?
Reply
#52
Tha main reason to have Java support for Tilengine is to have it running on Android... other than that, there are better languages.

Yes, using external DLLs/shared objects in C# is easier because:

  1. The binding code is written directly in C#, no need to create a separate native DLL bridge like Java (ouch!)
  2. The binding code is a little less verbose than Java
  3. It does support a native pointer type, so you have one single C# binding running in any architecture (x86, x64, ARM...)
That's why I choose C# instead of Java as a managed language for SuperMarioClone
Reply
#53
The reason I'm using Java is I learning it at school so it's the language I know the best.
But I shouldn't have too much trouble to move to C# and Python in the future.

By the way, is the problem with Oracle still here?
Reply
#54
Yes, Oracle problem still persist.

However I finally downloaded the 32-bit version from AdoptOpenJDK, that is the version I already had in 64-bit. Oracle even forces you to register an account just to say that they're experiencing problems when trying to download. Bad!

Better go here:
https://adoptopenjdk.net/
Reply
#55
I know this JDK, it's pretty good and also Open Source!

Did you downloaded the Version 8?
Reply
#56
Hi,
After installing 32-bit version of OpenJDK 8 and building 32-bit TilengineJNI.dll, everything works as expected. Here is a screenshot of TestPanel:


Attached Files Thumbnail(s)
   
Reply
#57
Does it work with the normal window? I also have multiples versions of Java, 2 for Java 8 : 32 and 64 bits. The problem is %JAVA_HOME% brings me to a 64-bits version. Is that the thing that causes the problem? can I compile a 32-bits JNITilengine with 64-bits JNI headers?
Reply
#58
Hi!

It works with the built-in window too, but I've posted the screenshot of the "TestPanel" because it has more integration with Java itself.
The headers for jni are the same for 32 and 64 bit, so the value of %JAVA_HOME% environment doesn't matter when building the TilengineJNI.dll library.
Make sure your C compiler is producing 32-bit binary, not 64-bit.

However, I don't know how to choose what JRE to run when typing "java" at the command prompt when you have both. To avoid problems I uninstalled the 64-bit one and replaced it with 32, so I don't have to choose.
Reply
#59
Which IDE are you using? I'm using IntelliJ IDEA so I can choose which version is used in the Project Structure window
Reply
#60
I use notepad++ for editing and the command-line to build and run
Reply


Forum Jump:


Users browsing this thread: 14 Guest(s)