
But at the moment, I feel that its not viable in its current state as even adding few extra command line arguments is going to break this in Windows. Ideally I would love to use Gradle to just run my app gradle run. For e.g I could see that classpath is pointing to a cached folder \fontbox\1.8.1` 32879bb6bb87b15c6d53bc358e83ede40fc729ae`\fontbox-1.8.1.jar
Is there a way to shorten some paths that gradle adds. ( I think what I’m working on is relatively small considering other big java apps I have seen). What’s the prescribed way to run applications that have a huge dependency graph. I worked around it by shortening the path to my code and java executable location, While this was Ok for sometime, I hit that limit again today when I added few command line argument. I ran in to an error java.io.IOException: CreateProcess error=206, The filename or extension is too long because of a really long classpath dependencies. Remember, the OS alternative should still refer to the JDK.I am beginning to move my maven based project to a gradle based java application that runs on Windows 7. So, even if you are indeed using the JDK instead of the JRE, the $JAVA_HOME has to point to the JRE. Which is where the tools.jar really resides. Which now resolves to /usr/local/java/jre/./lib/tools.jarĪnd finally to /usr/local/java/lib/tools.jar This new setup will cause maven to look at the JRE directory, that is part of the JDK: $JAVA_HOME\.\lib\tools To solve this, the $JAVA_HOME variable should instead point to this location /usr/local/java/jre (assuming the JDK path is /usr/local/java) - there is actually jre folder inside the JDK installation directory, that comes with each JDK.
It actually searches for the lib folder outside the java directory, because: $JAVA_HOME\.\lib\tools.jar The $JAVA_HOME variable pointed directly to my jdk folder ( /usr/local/java which was also the correct $PATH entry and alternative sym link). While I was using the correct JDK, I paid attention to the path of the tools jar maven complained about - it was expecting it to be $JAVA_HOME\.\lib\tools.jar
The problem was quite stupid to solve, yet counter-intuitive. I am using version 1.6, 1.7 and 1.8 simultaneously, and I have played a lot with the alternatives to have everything set properly. I was quite frustrated at first, because I have installed both the JDK and JRE.