Compile errors

Support for Windows users
Post Reply
User avatar
J. Scott Elblein
Posts: 37
Joined: 11 Jul 2014, 06:57

Compile errors

Post by J. Scott Elblein »

I haven't used FB for a while, and now for some reason the portable Windows install of FB stopped fetching the mediainfo data when renaming files, and I noticed there was a newer version, so, figured for shuts n grins, I'd play with compiling it myself, and maybe trying to customize the GUI a bit (move some buttons around, etc.). I've never spent a whole lot of time in the java coding world, so I'm not real familiar with the tools, and so on.

I installed Chocolatey, then via it, install ant, gradle, maven, groovy, etc., and cloned the latest repo from GH. When I run the command 'ant' in the root folder, I get what looks like dependency errors(?), and also a strange error about an older javac compiler version (I have the latest version of the JDK installed). Any idea what these are/how to resolve them?

Code: Select all

C:\Coding\Projects\FileBot>ant
Buildfile: C:\Coding\Projects\FileBot\build.xml

init:

revision:
     [echo] Revision: 5793

jar:
    [javac] Compiling 405 source files to C:\Coding\Projects\FileBot\build
    [javac] Support for javac --release has been added in Java9 ignoring it
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\mediainfo\MediaInfo.java:11: error: cannot find symbol
    [javac] import java.lang.ref.Cleaner;
    [javac]                     ^
    [javac]   symbol:   class Cleaner
    [javac]   location: package java.lang.ref
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\mediainfo\MediaInfo.java:30: error: package Cleaner does not exist
    [javac]     private Cleaner.Cleanable cleanable;
    [javac]                    ^
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\mediainfo\MediaInfo.java:320: error: cannot find symbol
    [javac]     private static final Cleaner cleaner = Cleaner.create();
    [javac]                          ^
    [javac]   symbol:   class Cleaner
    [javac]   location: class MediaInfo
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\ResourceManager.java:8: error: cannot find symbol
    [javac] import java.awt.image.BaseMultiResolutionImage;
    [javac]                      ^
    [javac]   symbol:   class BaseMultiResolutionImage
    [javac]   location: package java.awt.image
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\platform\mac\MacAppUtilities.java:10: error: package java.awt.desktop does not exist
    [javac] import java.awt.desktop.QuitStrategy;
    [javac]                        ^
    [javac] warning: C:\Coding\Projects\FileBot\dist\lib\controlsfx.jar(org/controlsfx/dialog/ProgressDialog.class): major version 53 is newer than 52, the highest major version supported by this compiler.
    [javac]   It is recommended that the compiler be upgraded.
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\UserFiles.java:35: error: cannot find symbol
    [javac]             if (Desktop.getDesktop().isSupported(Desktop.Action.MOVE_TO_TRASH)) {
    [javac]                                                                ^
    [javac]   symbol:   variable MOVE_TO_TRASH
    [javac]   location: class Action
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\UserFiles.java:37: error: cannot find symbol
    [javac]                             if (Desktop.getDesktop().moveToTrash(file)) {
    [javac]                                                     ^
    [javac]   symbol:   method moveToTrash(File)
    [javac]   location: class Desktop
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\UserFiles.java:54: error: cannot find symbol
    [javac]             if (Desktop.getDesktop().isSupported(Desktop.Action.BROWSE_FILE_DIR)) {
    [javac]                                                                ^
    [javac]   symbol:   variable BROWSE_FILE_DIR
    [javac]   location: class Action
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\UserFiles.java:57: error: cannot find symbol
    [javac]                                     Desktop.getDesktop().browseFileDirectory(children.get(children.size() - 1));
    [javac]                                                         ^
    [javac]   symbol:   method browseFileDirectory(File)
    [javac]   location: class Desktop
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\mediainfo\MediaInfo.java:320: error: cannot find symbol
    [javac]     private static final Cleaner cleaner = Cleaner.create();
    [javac]                                            ^
    [javac]   symbol:   variable Cleaner
    [javac]   location: class MediaInfo
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\ResourceManager.java:74: error: cannot find symbol
    [javac]                     return new BaseMultiResolutionImage(image.toArray(new Image[0]));
    [javac]                                ^
    [javac]   symbol:   class BaseMultiResolutionImage
    [javac]   location: class ResourceManager
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\platform\mac\MacAppUtilities.java:100: error: cannot find symbol
    [javac]             Desktop.getDesktop().setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS);
    [javac]                                                  ^
    [javac]   symbol:   variable QuitStrategy
    [javac]   location: class MacAppUtilities
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\platform\mac\MacAppUtilities.java:103: error: cannot find symbol
    [javac]             Desktop.getDesktop().setDefaultMenuBar(appMenuBar);
    [javac]                                 ^
    [javac]   symbol:   method setDefaultMenuBar(JMenuBar)
    [javac]   location: class Desktop
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\platform\mac\MacAppUtilities.java:106: error: cannot find symbol
    [javac]             Desktop.getDesktop().setOpenFileHandler(evt -> {
    [javac]                                 ^
    [javac]   symbol:   method setOpenFileHandler((evt)->{ L[...]; } })
    [javac]   location: class Desktop
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\platform\mac\DropToUnlock.java:166: error: cannot find symbol
    [javac]                                             invokeLater(1000, () -> Desktop.getDesktop().requestForeground(true)); // bring application to foreground now that folders have been unlocked
    [javac]                                                                                         ^
    [javac]   symbol:   method requestForeground(boolean)
    [javac]   location: class Desktop
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\platform\mac\xattr\XAttrUtil.java:66: error: cannot find symbol
    [javac]             return UTF_8.decode(bb).codePoints().takeWhile(c -> c != 0).collect(StringBuilder::new, StringBuilder::appendCodePoint, StringBuilder::append).toString();
    [javac]                                                 ^
    [javac]   symbol:   method takeWhile((c)->c != 0)
    [javac]   location: interface IntStream
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\ui\MainFrame.java:223: error: cannot find symbol
    [javac]                                     if (Desktop.getDesktop().isSupported(Desktop.Action.APP_REQUEST_FOREGROUND)) {
    [javac]                                                                                        ^
    [javac]   symbol:   variable APP_REQUEST_FOREGROUND
    [javac]   location: class Action
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\ui\MainFrame.java:224: error: cannot find symbol
    [javac]                                             Desktop.getDesktop().requestForeground(true);
    [javac]                                                                 ^
    [javac]   symbol:   method requestForeground(boolean)
    [javac]   location: class Desktop
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\ui\rename\CharacterHighlightPainter.java:39: error: cannot find symbol
    [javac]                     Rectangle2D p1 = mapper.modelToView2D(c, offset1, Bias.Backward);
    [javac]                                            ^
    [javac]   symbol:   method modelToView2D(JTextComponent,int,Bias)
    [javac]   location: variable mapper of type TextUI
    [javac] C:\Coding\Projects\FileBot\source\net\filebot\ui\rename\CharacterHighlightPainter.java:40: error: cannot find symbol
    [javac]                     Rectangle2D p2 = mapper.modelToView2D(c, offset2, Bias.Backward);
    [javac]                                            ^
    [javac]   symbol:   method modelToView2D(JTextComponent,int,Bias)
    [javac]   location: variable mapper of type TextUI
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 20 errors
    [javac] 1 warning

BUILD FAILED
C:\Coding\Projects\FileBot\build.xml:231: Compile failed; see the compiler error output for details.

Total time: 21 seconds
I've already run 'ant resolve' and it downloaded/installed a bunch of stuff, and the above errors are still the result. For the record, I'm compiling this on a Win 10 x64 VM machine.

TIA
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Compile errors

Post by rednoah »

FileBot usually requires the latest Java, which is currently Java 10. The errors indicate that you're using and older release of Java.

:idea: Note that custom builds are only feasible for offline functionality, as you'd need to create your own server-side infrastructure and apply for your own API keys for all the online functionality.

:arrow: I recommend just using one of the new official builds: https://get.filebot.net/filebot/
:idea: Please read the FAQ and How to Request Help.
User avatar
J. Scott Elblein
Posts: 37
Joined: 11 Jul 2014, 06:57

Re: Compile errors

Post by J. Scott Elblein »

Image

Image

:?

I was thinking I'd play with he GUI a bit; I've always kinda wanted the buttons in different places than they are, and some other tweaks, and then grab a license, and use it with my 'tweaked' build.
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Compile errors

Post by rednoah »

You might need to set the JAVA_HOME environment variable as well. ant is probably using Java 8 for some reason.

ant -diagnostics will tell you what version of Java and other libraries it's working with:

Code: Select all

ant -diagnostics
:idea: Please read the FAQ and How to Request Help.
User avatar
J. Scott Elblein
Posts: 37
Joined: 11 Jul 2014, 06:57

Re: Compile errors

Post by J. Scott Elblein »

That did it. I had JAVA_HOME pointing to the older version of JDK. Builds like a charm now. :D

If I can get the gist of everything I may or may not submit some pull requests. :P
User avatar
rednoah
The Source
Posts: 22994
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Compile errors

Post by rednoah »

You'd be the first, or the second at the very least. :lol:
:idea: Please read the FAQ and How to Request Help.
Post Reply