[solved] I Can't built my project, I can't anderstand the error message

Hello,

I have got an error when trying to built my project, I don’t anderstand it :

ant -f /home/christian/Jmonkey_projects/CM_Game clean jar
init:
deps-clean:
Updating property file: /home/christian/Jmonkey_projects/CM_Game/build/built-clean.properties
Deleting directory /home/christian/Jmonkey_projects/CM_Game/build
clean:
Building jar: /home/christian/Jmonkey_projects/CM_Game/build/assets.jar
init:
deps-jar:
Updating property file: /home/christian/Jmonkey_projects/CM_Game/build/built-jar.properties
Created dir: /home/christian/Jmonkey_projects/CM_Game/build/classes
Created dir: /home/christian/Jmonkey_projects/CM_Game/build/empty
/home/christian/Jmonkey_projects/CM_Game/nbproject/build-impl.xml:914: The following error occurred while executing this line:
/home/christian/Jmonkey_projects/CM_Game/nbproject/build-impl.xml:305: Class not found: javac1.8
BUILD FAILED (total time: 1 second)

have you an idea about it? Thank you for your help :smiley:

He said some class is not found but which one?

I have made another project, with only the default SimpleApplication in it, and I have the same message. Yet the game does compile and run, just does not built for deployment :frowning:

I am going to post what I have got at the line 305 and 914, but I am affraid it is not revelant.

He says javac1.8 not found. Javac is the JavaCompiler.

Try to install the jdk8 or build for Java 7 or less

Hello Darkchaos,

Thank you for your answer, I didn’t know “javac1.8” was the name of a class, I thought it was only a signature.

So I have had a look at my system, my OS is Linux. I am trying to see what version of java I have got. When typing “wheris” on a termial, It found java, but not javac, the compiler. I don’t anderstand how Jmonkey succeeds to compile (to “make”) without having javac. Once again my applies run on the JDK environment, I just can’t “built” them.

This is the command that is lunched when I run Jmonkey :

/usr/local/jmonkeyplatform/bin/jmonkeyplatform --jdkhome /usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/

So it seems to be the right version?

Well javac is infact rather an application then a class.

Type the following commands to read out your java versions:
java -version (Note: it’s only one(!) - ) => JRE Version
javac -version => JDK Version.

Mine are both 1.8.0_40.
Note that Java is confusing here as 1.8 means Java 8

If you don’t have javac you might have a naming/linking problem (due to openjdk over proprietary)
Also what is in that Line 305? perhaps you’d have to change javac1.8 to javac there?

As for why jmonkey compiles: Jme only needs java 1.5 (so 1.1.5 in java terms), so it seems like you possibly simply address the wrong compiler?

Do the following:
ls -lsh /usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/ | grep javac
If that displays an javac (or javac 1.8 executable) you need to ln -s /usr/lib/jvm/..../* /usr/bin
(Look up the syntax, I am uncertain here. Also you might want to only link javac(1.8) to not overwrite another jdk you have running or something)

Thank yo for your answer. The point is I have no javac at the command line input Linux (I have java).
I am looking for the other points.

When I look at the directory /usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/ , I have no links, only the following

-rw-r--r-- 1 uucp  143   123324 mars  17  2014 THIRDPARTYLICENSEREADME-JAVAFX.txt
-rw-r--r-- 1 uucp  143  4673034 mars  17  2014 javafx-src.zip
-r--r--r-- 1 uucp  143   178445 mars  18  2014 THIRDPARTYLICENSEREADME.txt
-rw-r--r-- 1 uucp  143 21049655 mars  18  2014 src.zip
-rw-r--r-- 1 uucp  143      525 mars  18  2014 release
-r--r--r-- 1 uucp  143      159 mars  18  2014 README.html
drwxr-xr-x 4 uucp  143     4096 mars  18  2014 man
-r--r--r-- 1 uucp  143       40 mars  18  2014 LICENSE
drwxr-xr-x 3 uucp  143     4096 mars  18  2014 include
drwxr-xr-x 4 uucp  143     4096 mars  18  2014 db
-r--r--r-- 1 uucp  143     3244 mars  18  2014 COPYRIGHT
drwxr-xr-x 5 uucp  143     4096 mars  18  2014 jre
drwxr-xr-x 2 uucp  143     4096 mars  18  2014 bin
drwxr-xr-x 5 uucp  143     4096 mars  18  2014 lib
drwxr-xr-x 8 uucp  143     4096 mars  18  2014 .
drwxr-xr-x 3 root root     4096 mai   15  2014 ..

In the bin directory, I have got executables, including java and javac.

The line 305 is the following (I had to delete the balise for the text to appear but it begin by “<” and ends by “>”

javac debug="@{debug}" deprecation="${javac.deprecation}" destdir="@{destdir}" encoding="${source.encoding}" excludes="@{excludes}" fork="${javac.fork}" includeantruntime=“false” includes="@{includes}" source="${javac.source}" sourcepath="@{sourcepath}" srcdir="@{srcdir}" target="${javac.target}" tempdir="${java.io.tmpdir}"

That’s it!!
You need to use the javac from the bin directory in there.
This either by linking the bin folder to /usr/bin or by editing the BASH PATH in .profile (google it)

I wonder if it’s not possible to specify a path to javac in ant?

I suppose Jmonkey uses the bash path, and not directly points to /usr/lib/jvm… I try to add that directory to the bash path.

I don’t know if it uses the bash path or is somehow detecting the jdk. (As your javac isn’t on the bash path, so it shouldn’t compile either)

Also it’s odd that the ant file looks for javac1.8 instead of javac.
But at least you now have the right direction to try :wink:

I have added the directory to the bash path and I have the same error.

What is ANT and where can I find the make launcher and the built launcher?

I see that ant is not known by bash

from your first line:
ant -f /home/christian/Jmonkey_projects/CM_Game clean jar
→ This means that the ant build tool will take the “script” (Makefile) located in …/CM_Game/build.xml

And this shows that ant is known by bash?
But if you need support for ant files, you’d have to wait for a CoreDeveloper or somebody to join in as I don’t know them.
I am happy if it works on keypress^^

I said that bash does not know javac because when I tape “$ whereis javac” at a terminale, it says that it is not known (but java is)

I realise that I have two installations of Java (but both of them have javac in the bin directory) : one into /usr/bin/jmonkey… and another into /usr/bin/… (another path).

I will see that this afternoon. Thank you for your help.

PS 15:51 : no I mistake, the java under /etc/bin points to the one under /usr/lib/jvm/… it’s the same install.
Under /usr/bin I have got this:

java:                                            symbolic link to `/etc/alternatives/java'
javaws:                                          symbolic link to `/etc/alternatives/javaws'

And under /etc/alternatives I have got this:

itweb-settings:                                symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/itweb-settings'
itweb-settings.1.gz:                           symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/itweb-settings.1.gz'
java:                                          symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java'
java.1.gz:                                     symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/java.1.gz'
javaws:                                        symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/javaws'
javaws.1.gz:                                   symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/javaws.1.gz'
jexec:                                         symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jexec'
jexec-binfmt:                                  symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jar.binfmt'
keytool:                                       symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/keytool'
keytool.1.gz:                                  symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/keytool.1.gz'
mozilla-javaplugin.so:                         symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so'
orbd:                                          symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/orbd'
orbd.1.gz:                                     symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/orbd.1.gz'
pack200:                                       symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/pack200'
pack200.1.gz:                                  symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/pack200.1.gz'
policytool:                                    symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/policytool'
policytool.1.gz:                               symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/policytool.1.gz'
rmid:                                          symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/rmid'
rmid.1.gz:                                     symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/rmid.1.gz'
rmiregistry:                                   symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/rmiregistry'
rmiregistry.1.gz:                              symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/rmiregistry.1.gz'
servertool:                                    symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/servertool'
servertool.1.gz:                               symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/servertool.1.gz'
tnameserv:                                     symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/tnameserv'
tnameserv.1.gz:                                symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/tnameserv.1.gz'
unpack200:                                     symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/unpack200'
unpack200.1.gz:                                symbolic link to `/usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/unpack200.1.gz'

As you can see , javac does not appear, I try to add it.

PS 16:11 : instead of adding javac , I have try to add /usr/lib/jvm/java-1.7.0-openjdk-amd64/jdk/jdk1.8.0_05/bin to the path (again, but either before or after the PATH), and it does not work. Nevertheless, javac exists at that directory.

1 Like

I don’t anderstand, I add /usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/bin to the PATH, and when I do whereis javac, it does find it. I have done the following script:

#!/bin/sh
export PATH=/usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/bin:$PATH
echo $PATH
whereis javac

The result is:

/usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
javac: <-----(nothing)

If I put java, it works but it find the one under /usr/bin/

java: /usr/bin/java /usr/bin/X11/java /usr/share/java /usr/share/man/man1/java.1.gzjava: /usr/bin/java /usr/bin/X11/java /usr/share/java /usr/share/man/man1/java.1.gz

Nevertheless the dirrectory /usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05//bin is before /usr/bin in the PATH. I don’t anderstand.

Try javac -version.
Propably whereis is only checking the default paths or something.
It only matters if you are able to execute javac then.

Propably cding into that dir and anting from there might work as well?

Javac -version doesn’t work any more. Speaking about cding into the directory, I am affraid this would make other things not work. However I would like to succeed in adding a directory in the PATH, I don’t know why this does not work, it seems that this does not work like in Unix (I use to work with) like in Linux. Or may be it’s a particularity of bash.

Well. It should work regardless of the working dir (with everything in /usr/bin),

Usually PATH should work as well (even on mac os), but there are multiple shells
shells on Debian (sh and bash), so that might interfere.

anyway i’d try to fix the ant file (just like the Configure in the make-process searches for paths and correct Binaries)

I have tried several solutions, none work. I have tried to cd into the directory, or add it in the PATH, also sourcing the command file instead of launching it (doing $ . .<file.sh> ) nothing works.

Another thing : I don’t know how the system find ant because it is only present in a directory that is not in the path.

When I add the directory "/usr/lib/jvm/java-7-openjdk-amd64/jdk/jdk1.8.0_05/bin" to the path, javac is recognized (when typing $ which -a javac I get the file that is used for javac). But the built get the same error message.