Tips on compiling JBidwatcher?

Subscribe to Tips on compiling JBidwatcher? 5 post(s), 4 voice(s)

 
Avatar mconsidine 1 post

Hi,
I have had JB fail on a snipe a couple of times now and would like to compile from the latest codes. I have eclipse installed as well as the community version of IntelliJ IDEA. I also see that there’s a master and 3.0 version of code on github.

When I download either of the sets of code and run, for example
ant clean jar
or
ant clean exe
I get executables that load and which show me the toolbar, icon, etc. But none of the menu picks do anything. It does appear to log me into ebay, but according to the error file, runs into issues after that.

Can anyone give me some steps or pointers on how they have successfully compile JB on Windows (Vista, in my case). Thank you.
Matt
PS Here’s the error I was getting :
Wed Dec 31 18:20:18 EST 2014: JBidwatcher 2.99pre1-
Wed Dec 31 18:20:18 EST 2014: Oracle Corporation Java, version 1.8.0_25 on Windows Vista
Wed Dec 31 18:20:18 EST 2014: Logging to C:\Users\Matt\.jbidwatcher\errors.39.log
Wed Dec 31 18:20:22 EST 2014: Loaded the appropriate driver.
Wed Dec 31 18:20:27 EST 2014: Connected to database jbdb (JBidwatcher DataBase)
Wed Dec 31 18:20:31 EST 2014: Auction information database already exists.
Wed Dec 31 18:20:31 EST 2014: Closed connection
Wed Dec 31 18:20:35 EST 2014: Database shut down normally
Wed Dec 31 18:20:36 EST 2014: Loaded the appropriate driver.
Wed Dec 31 18:20:39 EST 2014: Connected to database jbdb (JBidwatcher DataBase)
Wed Dec 31 18:20:39 EST 2014: Closed connection
Wed Dec 31 18:20:39 EST 2014: Database shut down normally
Wed Dec 31 18:20:40 EST 2014: Scripting is not enabled.
Wed Dec 31 18:20:44 EST 2014: Loaded the appropriate driver.
Wed Dec 31 18:20:45 EST 2014: Connected to database jbdb (JBidwatcher DataBase)
Wed Dec 31 18:20:47 EST 2014: Loading listings from the database (1/18/19 entries, 18/401 auctions)
Wed Dec 31 18:20:47 EST 2014: Done with the initial load (got 0 active entries)
Wed Dec 31 18:20:47 EST 2014: Auction Entries loaded
Wed Dec 31 18:20:47 EST 2014: Completed loader spun off
Wed Dec 31 18:20:47 EST 2014: Snipes processed
Wed Dec 31 18:20:47 EST 2014: findAuctions: 0.0 × 1(0)
Wed Dec 31 18:20:47 EST 2014: counts: 1124.0 × 1(1124)
Wed Dec 31 18:20:47 EST 2014: findAll: 31.0 × 1(31)
Wed Dec 31 18:20:47 EST 2014: Last 10 from addEntry:
Wed Dec 31 18:20:53 EST 2014: Parsing URL http://viv.ebay.com/ws/eBayISAPI.dll?EbayTime
Wed Dec 31 18:20:54 EST 2014: Time delta with ebay.com is -680
Wed Dec 31 18:20:54 EST 2014: Getting the sign in cookie for ebay.com
Wed Dec 31 18:20:54 EST 2014: Parsing URL https://signin.ebay.com/ws2/eBayISAPI.dll?SignIn
Wed Dec 31 18:20:57 EST 2014: Parsing URL https://signin.ebay.com/ws/eBayISAPI.dll?co_partnerId=2&siteid=0&UsingSSL=1
Wed Dec 31 18:20:58 EST 2014: Done getting the sign in cookie for ebay.com
Wed Dec 31 18:20:58 EST 2014: SMQ Caught exception: java.lang.NullPointerException
java.lang.NullPointerException
at com.jbidwatcher.app.UIBackbone.alterSnipeStatus(UIBackbone.java:354)
at com.jbidwatcher.app.UIBackbone.messageAction(UIBackbone.java:194)
at com.jbidwatcher.ui.SwingMessageQueue.run(SwingMessageQueue.java:26)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Wed Dec 31 18:21:01 EST 2014: Parsing URL http://www.jbidwatcher.com/jbidwatcher2.xml
Wed Dec 31 18:21:11 EST 2014: SMQ Caught exception: java.lang.NullPointerException
java.lang.NullPointerException
at com.jbidwatcher.app.UIBackbone.alterSnipeStatus(UIBackbone.java:354)
at com.jbidwatcher.app.UIBackbone.messageAction(UIBackbone.java:194)
at com.jbidwatcher.ui.SwingMessageQueue.run(SwingMessageQueue.java:26)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Wed Dec 31 18:21:32 EST 2014: Saving to: C:\Users\Matt\.jbidwatcher\JBidWatch.cfg
Wed Dec 31 18:21:32 EST 2014: Closed connection
Wed Dec 31 18:21:32 EST 2014: Database shut down normally
Wed Dec 31 18:21:32 EST 2014: Closed connection
Wed Dec 31 18:21:32 EST 2014: Database shut down normally
Wed Dec 31 18:21:32 EST 2014: Closed connection
Wed Dec 31 18:21:32 EST 2014: Database shut down normally
Wed Dec 31 18:21:32 EST 2014: Closed connection
Wed Dec 31 18:21:32 EST 2014: Database shut down normally
Wed Dec 31 18:21:32 EST 2014: Closed connection
Wed Dec 31 18:21:32 EST 2014: Database shut down normally
Wed Dec 31 18:21:32 EST 2014: Closed connection
Wed Dec 31 18:21:32 EST 2014: Database shut down normally
Wed Dec 31 18:21:32 EST 2014: Closed connection
Wed Dec 31 18:21:32 EST 2014: Database shut down normally
Wed Dec 31 18:21:32 EST 2014: Closed connection
Wed Dec 31 18:21:32 EST 2014: Database shut down normally
Wed Dec 31 18:21:32 EST 2014: Shutting down JBidwatcher.

 
Avatar Morgan Schweers Administrator 1,204 post(s)

Greetings,
Unfortunately building JBidwatcher does not result in an .EXE file on Windows. In order to build an .exe file, you need to wrap it using a tool named ‘launch4j’. I do my builds on Linux (and occasionally on Mac OS X) where I have a cross-compiled version of mingw’s compiler that will generate .exe files for Windows. I do the packaging, that is creating the installer, on Windows using the Excelsior Installer.

I’ve actually merged the 3.0 branch into master, and am doing all my development on master now again. The next version of JBidwatcher will have multiple packages installed into a lib/ directory, with a main executable that loads the extra .jar files at runtime, and will require the scripting component. (Notice that in your logs above, it says ‘Scripting is not enabled.’)

I believe it’s possible to build a launch4j installation for windows, but I’ve never done it. In any case, the key is that you now need to create a directory that contains the executable (in your case, I’m betting you ran the .jar file, not an .exe file), and a lib/ directory that contains everything in the JBidwatcher lib/ tree.

If you have that in place, it should successfully launch and you should see scripting enabled in the log files, at which point the menus will work again, as should everything else.

Honestly, nobody’s shown the slightest interest in JBidwatcher’s source code in years, so I stopped thinking about it as something that other people were going to build (and thus no real documentation about build processes, etc.) and have kept development public more out of habit than anything else. I’m sorry about that.

— Morgan Schweers, Cyber*FOX*!

 
Avatar salimoneus 8 post(s)

Not too familiar with Java, but may start playing around with the source. A couple questions if I may.

Is it perfectly valid and acceptable to run the program in .jar format on Windows?

What is the main benefit of creating an .exe? Is it like a “static” link to the Java libraries and eliminates the requirement of needing a local JRE? Or is it simply a convenience thing in that you don’t need to mess around with a command line…

 
Avatar MickoZ 14 post(s)

Hi Salimoneus, I can answer your questions…

1) Yes, we can run the .jar on Windows, that is actually how I run JBidwatcher because I can use the command line and tweak the memory allowed to it (it is so memory hungry, at least for me, eh). Here is my current command line:

java -d64 -jar -Xms768m -Xmx1800m JBidwatcher-2.5.6.jar

I use the -d64 to run it in 64-bit (maybe not the best choice to save memory space, but I think I did that so I can put higher max memory limit [?] and well the Xms and Xmx is to define the amount of memory allocated at start and the max it can use).

2) I think you are on the right track guessing what is the benefit for .exe for a Java proggy (imagination and guessing are some of my best tools to understand anything, even thing I never heard of :D). Apparently, we can bundle or not the JRE with it. Also, you can embed command line into it, so user don’t have to mess with it. And people are more familiar with .exe (still, nowdays you can usually double click on a .jar to run it, so…). I would guess there is couple of program that does this, but like Morgan said, he use Launch4j and there is a good introduction there that say basically the same thing as we say:

“Launch4j is a cross-platform tool for wrapping Java applications distributed as jars in lightweight Windows native executables. The executable can be configured to search for a certain JRE version or use a bundled one, and it’s possible to set runtime options, like the initial/max heap size. The wrapper also provides better user experience through an application icon, a native pre-JRE splash screen, and a Java download page in case the appropriate JRE cannot be found.”

For more info, I would suggest to look around its website, its features, etc. at http://launch4j.sourceforge.net/

 
Avatar Morgan Schweers Administrator 1,204 post(s)

Greetings,
Making it an .exe file allowed me to give it an icon, wrap it in an installer, give a sane error message that a JVM is needed for users who might not realize that, set some JVM parameters (like @MickoZ has set), force a minimum Java version, give it Windows-specific attributes (like version, company name, and product name), and generally make it ‘palatable’ to a non-technical audience.

Almost none of that is relevant if you’re building your own, because you’re already at a technical level above where that stuff is needed. :)

That said, the next version (3.0) is going to rely a LOT more heavily on the installer, I think. I’ve been wanting to extract all the various .jar files that are embedded in JBidwatcher out for a while, and (while I can’t do that on Linux) I’ve long-since done it that way on Mac OS X and I’m going to start doing it that way on Windows.

Again, for the most part, if you’re at a technical level that you’re building the software yourself, this won’t matter. In fact, it might make things a little faster for you…

— Morgan Schweers, CyberFOX!