I don’t know about your platform… but on Windows, the builds look for Javac in JAVA_HOME… and it doesn’t matter how many times you mention it in the path.
Thank you for this information, I will look at that. Could you say what is the value of JAVA_HOME on your platform? I will adapt on mine, thank you.
It points to the directory where the JDK is installed.
I have done the following:
export JAVA_HOME="/usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/bin" export PATH=$PATH:$JAVA_HOME /usr/local/jmonkeyplatform/bin/jmonkeyplatform --jdkhome /usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/
It does not work, even if I cd in the directory bin before.
Is your JDK installed in the bin subdirectory? Probably not.
No, the JDK home is
bin at the end. It is the reason why I specified this for the argument --jdkhome. But the environment variable
JAVA_HOME is (I suppose) for specifying where the executables are,
javac, etc, and so I put
bin at the end for
JAVA_HOME. And they are really there.
But any way, I have tried to put bin at the end or not for both of them, and it does not work
Please install the package openjdk-devel of your GNU Linux distribution and it will work like a charm. Ensure that you remove your useless attempts of tinkering/breaking your system. I use OpenJDK to build several engines including JMonkeyEngine under Mageia Linux 4 and I have no such problems. Good luck.
I have installed OpenJDK Development as you can see : java-7-openjdk-amd64/jdk.
Oh excuse me, you mean openjdk-devel , I realise that it is not the same. I am looking for an instller for my distrib Linux Mint Petra.
Waiting for that, could you explain how do you do for configuring Jmonkey in the jdk, I mean when you first install a jdk and Jmonkey afterwards?
In my humble opinion, you haven’t installed java-1.8.0-openjdk-devel or openjdk-8-jdk, try:
sudo apt-get install openjdk-8-jdk
The JRE of OpenJDK is installed by default on your distribution but not the JDK. Why do you talk about an installer??? You should use a package compatible with your distribution, preferably from its official repository.
Setting the environment variable JAVA_HOME isn’t mandatory but you can do so in your .bashrc file in your home directory.
You don’t need to install JMonkeyPlatform or JMonkeyEngine in it, it will just pick it if it is correctly installed.
Edit.: See JMonkeyEngine as a third party library, a plain library. There are just a bunch of JAR files.
Yes I said “installer”, I mean the package manager. I know, the jdk is not installed by default, and I have install it but it is java-7-openjdk-amd64/ and not java-1.8.0-openjdk-devel . May be I could install this version, but how do you “plug” Jmonkey in it.
I don’t anderstand your sentence : You don’t need to install JMonkeyPlatform or JMonkeyEngine in it, it will just pick it if it is correctly installed. . If Jmonkey is not install the makefile of the jdk would not work, and it would not install Jmonkey itself? I have to do it, and to “plug” it in the makefiles , i don’t know how
Say me if I am wrong:
I desinstall Jmonkey
I desinstall the JDK7 (not the JRE),
I install openjdk-devel-8
I install Jmonkey
Is that right?
It’s called openjdk-8-jdk on Debian based distros including Ubuntu, Mint… and java-1.8.0-openjdk-devel on Redhat based distros including Fedora, Mageia…
You can uninstall the JRE too and then install the latest one (supporting Java 1.8 too). JMonkeyEngine is composed of several JARs and putting the JARs into the JDK/JRE is a bad practice as it can break any application requiring a specific version of a library, it’s better to use the classpath specific to a single application instead of affecting all Java applications and applets.
Personally, I would uninstall JMonkeyPlatform and openjdk-7-jre, then I would install openjdk-8-jre, openjdk-8-jdk and JMonkeyPlatform (run the shell script). This script requires JAVA_HOME to be set, I’ve just checked that.
Thank you for your answer. The problem is I can’t remember how I have installed Jmonkey. My software manager do not see Jmonkey, is there a risk if I desinstall it using the apt-get command?
Another thing : I don’t anderstand what you mean by a classpath specific to a single application. I don’t see what I will have to do in my JDK for him to know what to do when I will do “make my_Jmonkey_apply”
You probably installed JMonkeyPlatform by running its (very big, about 372 MB) bash script in the “Download” section but I can’t help if you don’t know how you obtained it. You can’t uninstall a software with apt-get if it isn’t packaged as a DEB package. Anyway, why not keeping the platform as is?
I advise you to learn the basics:
Oracle Java SE Documentation: Setting the class path
You can learn how to use the SDK here in the wiki.
Why do you talk about “make”? There is no need to use a makefile. The build tool or the build system takes what is available in the path by default or relies on JAVA_HOME. You mustn’t modify the JDK. It’s the build tool (Gradle, Ant, Maven, …) that knows which JDK to use in order to compile.
Edit.: Use at least Ant 1.9.0 with Java 1.8. Otherwise, you will get the same error message than in your very first post.
I think it works now!
I have seen at one of the links you have given that I could give the inline option:
I tried to add this in the properies->build->compiling in Jmonkey, but it did not take into account this option, it continues to look for javac1.8 instead of javac1.7
But after many searches, I have seen in some config file in Jmonkey environment that you can pass an option to the compiler by passing it at the command line preceeding it by “-J” . So I put the option
"-J-Dbuild.compiler=javac1.7" at the command line of the launcher that I had written. Here is now the content of this launcher:
#!/bin/sh /usr/local/jmonkeyplatform/bin/jmonkeyplatform --jdkhome /usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/ -J-Dbuild.compiler=javac1.7
It works, it build the dist directory where you have the needed other directories, and the jar file that can be run directly by typing
"$ java -jar <the jar file>"
I will see now if that jar file runs on a Windows machine, that was the goal.
Thank you for your help
You’re welcome but you still use Java 1.7.
I don’t see why your JAR would work under GNU Linux but not under Windows.
This doesn’t happen with the download of the SDK. Did you somehow compile the SDK from github and try to use that?
Yes, it works fine on Windows (xp).
Yes I sill use Java1.7 , for the built only, I think. But it was the only solution for the problem I had. If you see another solution, I would try it.
Speaking the SDK, I have downloaded it, not made it from the source.
No, you must have either opened the project in a current NetBeans version, didn’t use the supplied BasicGame project or otherwise changed the build scripts of the project. The Java JDK 1.7 is bundled with the SDK and its used by default.