• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Build path errors

 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I wish to clone a github project into an IDE

The URL for the project is :- https://github.com/adesolaadegboye/SymbolicRegression

I have tried both Eclipse IDE and IntelliJIDEA IDE

Both result in build path errors

[a] Eclipse

Description Resource Path Location Type
Project 'DirectionalChange' is missing required library: 'C:\Users\atna3\workspace\dc\lib\autoweka.jar' DirectionalChange Build path Build Path Problem
Project 'DirectionalChange' is missing required library: 'C:\Users\atna3\workspace\dc\lib\commons-math3-3.6.1.jar' DirectionalChange Build path Build Path Problem
Project 'DirectionalChange' is missing required library: 'C:\Users\atna3\workspace\dc\lib\joda-time-2.9.9.jar' DirectionalChange Build path Build Path Problem
Project 'DirectionalChange' is missing required library: 'C:\Users\atna3\workspace\dc\lib\SMOTE.jar' DirectionalChange Build path Build Path Problem
Project 'DirectionalChange' is missing required library: 'C:\Users\atna3\workspace\dc\lib\ta4j.jar' DirectionalChange Build path Build Path Problem
Project 'DirectionalChange' is missing required library: 'C:\Users\atna3\workspace\dc\lib\weka.jar' DirectionalChange Build path Build Path Problem
The project cannot be built until build path errors are resolved DirectionalChange Unknown Java Problem

I am very confused with the C:\Users\atna3......... paths listed above ???

[b] IntelliJIDEA

The following is a list of the problematic java files and the no. of errors/warnings

   GA_new_checkedInAlready.java - 1 error
   GA_new_TradingWithAllThreadshold.java - 1 error
   FReader.java - 2 errors and 2 warnings
   DCCurve.java - 13 errors and 10 warnings
   PreProcess.java - 39 errors
   myAutoWeka.java - 44 errors and 1 warning
   DCCurveRegression.java - 25 warnings
   DCCurveClassification.java - 1 warning
   PerfectForecastDCCurve.java - 6 warnings
   TreeHelperClass.java - 4 warnings
   DCCurveClassificationTOSAverage.java - 4 warnings
   DCCurveClassificationTOSDDCUDC.java - 4 warnings
   DCCurveDCCOnlyAndTrail.java - 3 warnings
   DCCurveFeatureExtractCostSensClassifier5Indicators.java - 32 warnings
   DCCurveFeatureExtractionCostSensitiveClassifier.java - 8 warnings

I can see the various .jar files mentioned under the lib folder

Please, I am seeking some pointers on what to do next to get rid of the errors so that I can achieve a clean and successful build

Grateful for any advice

BobM
Dunedin
New Zealand
 
Saloon Keeper
Posts: 13014
281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The project has dependencies on libraries that were installed on the author's private development machine. This is poor form for an open source project that was meant for public consumption.

You have two options: download the required libraries manually and modify the project's dependency paths, or convert the project to use a build tool like Maven, which will download the dependencies for you. I strongly recommend the second option.
 
Saloon Keeper
Posts: 23774
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is definitely not well-formed as an open-source project.

Just to start with, a good github shareable project needs a README.md file that describes what the project is good for, what it needs to run, and how to build it.

Plus a first-class shareable project shouldn't be dependent on an IDE at all., It should be buildable using Maven, Gradle, Ant-with-Ivy or some other universal build tool.

Lacking that, as Stephan has noted, you either need to manually create your own build profile that pulls in the missing dependencies automaticallyt or at the very least, manually download the dependent libraries and install them where the Eclipse project builder can findd them.
 
Bob Matthews
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Tim and Stephan for your comments...........

In Eclipse, I created a C:\Users\atna3 folder and copied the various 'missing' jar files into it.

The build appears to have no errors and when I choose 'Run' I get many java programs to choose from, although the long list seems to include many duplicate references

It was my choice to utilize an IDE

Is that choice OK or should I come away from using an IDE at all ?

However, I don't see a pom.xml file so how can I build it with Maven ?

Do you think it is OK to proceed ?

Bob M

p.s. I have emailed the author regarding these problems
 
Tim Holloway
Saloon Keeper
Posts: 23774
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The original project was an Eclipse project. I can tell that because it has a ".project" file in it.

But the problem with IDE-only builds is that they only work if your computer is a fairly close clone of the computer that the project was originally built on. And that includes not only what's defined in the project, but also what's defined to Eclipse as a whole. Which is the ugly part, since often their setup will not be compatible with yours.

A build system like Maven, on the other hand is designed in such a way that I can erase all my temporary files using a "mvn clean" command, ZIP up the clean project, email it to Ulan Bator, and the person on the receiving end can build an identical functional copy of the executable system with nothing else but compatible versions of the JDK and Maven applications. And on top of that, they can do so on a completely non-GUI system (my production servers don't have any sort of window/desktop installed) OR they can be built under control the the Maven pluging for Eclipse.

The downside is that you do have to put specific things in specific places. For example, application source in src/main/java, test source in src/test/java, and so forth, but on the other hand, that also makes it easier for other people to know where to find stuff in the project.
 
Bob Matthews
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim..........

So I have 2 choices:-

1) build the project using Maven away from any IDEs

2) build the project in Eclipse using the Maven plugin

Will I be able to achieve a clean build with this particular project ?

BobM
Dunedin
New Zealand
 
Bob Matthews
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK

If I choose to try and build this project in Eclipse using the Maven plugin could you please post very specific, low-level instructions on how to achieve this ?

What I have done to date:-

1) deleted Eclipse manually
2) reinstalled Eclipse
3) that's it so far

Bob
Dunedin
New Zealand
 
Stephan van Hulst
Saloon Keeper
Posts: 13014
281
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You really ought to get comfortable with the Maven command line tool, and read the quickstart and POM reference on the Maven site first.
 
Bob Matthews
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK

I have installed Maven successfully

When I use the command:- mvn -v I get several lines as per shown in examples

So far - so good

But , now am unsure how to clone the project from github using Maven

I can see how to download the project as a zip.file

Bob
 
Stephan van Hulst
Saloon Keeper
Posts: 13014
281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you read the Maven POM Reference yet? Read it, and then write a minimal POM for the application. For the dependencies, you need to check the libraries in the project's build path, and see if there is a Maven version of them. You can easily google something like "Maven Joda Time" to find this in Maven central:

https://mvnrepository.com/artifact/joda-time/joda-time/2.10.10

The page shows how you add the dependency to the POM.
 
Bob Matthews
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to be clear Stephan.............

The point of this exercise is to retrieve the source code from the github repository and then to build a project using Maven correcting paths etc. on the fly

Bob M

 
Tim Holloway
Saloon Keeper
Posts: 23774
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your options are basically these:

1. Fiddle with Eclipse until it can build the project itself.

2. Convert the project so that it can be build using Maven (or a similar build system)

For option 1, you're on your own. It's doable and in my pre-Maven days that how I did things. But it's a real pain and we don't know enough about the project to be much help.

For option 2, you'll have to re-organize the directory tree to put the files in places where Maven wants to find them (like src/main/java) AND you have to create a POM that will tell what to build, what kind of thing you're building, and what external dependencies are needed to build it.

Maven itself consists of achieving specified goals, so just "mvn" on the command line doesn't do much. To compile a project, you'd need to invoke the "compile" goal, thus: "mvn compile:compile", Some of the more advanced goals such as "install" automatically invoke more primitive goals (like the "compile" goal). That, actually, is the part of Maven I'm least comfortable with, but it does become second nature after a while.
 
Bob Matthews
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim..............

I am happy to try both approaches together

I like the IDE approach because ultimately I need to run a java program that trades on the particular forex platform I use and there are examples of how to do this via Eclipse

I like the second option, as we are independent of any IDE but I am struggling with the whole concept - you have explained it a bit further

As far as the IDE approach goes, in Eclipse, I created a C:\Users\atna3 folder and copied the various 'missing' jar files into it.

The build appears to have no errors and when I choose 'Run' I get many java programs to choose from, although the long list seems to include many duplicate references

But what I don't know is whether I am free of any problems ??

Bob M
p.s. there is an academic paper (15 pages) which explains the project totally

p.p.s. a quick look at the source files shows 94 java files, 3 excel files, 5 text files -> so trying to get the project working under Eclipse may be a 'pie in the sky' idea
 
Tim Holloway
Saloon Keeper
Posts: 23774
161
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not to burst your bubble, but we're all unpaid here, so digesting a 15-page document and unsnarling someone else's project is going to get more encouragement than actual step-by-step help here.

What I did in the far-off days was create an Eclipse project just to hold library JARs and use the Eclipse inter-project connection features to let the dependent projects find them. Another thing I've done is setup named paths using Eclipse variable definitions. Neither of those is a trivial option, though. Maven is much more civilized.

The glorious thing for me about Eclipse is that you can manage many different projects and even run them all at the same time. That's especially nice if you are working on a client-server system and you want Eclipse to be able to debug both client and server code at the same time. But what it means to you is that you can create Run/Debug profiles for your projects, define exactly what characteristics a given profile has (for example, JVM selected, classpath, command-line options and so forth), then use the Run/Debug menu to launch that profile. Meaning that Eclipse isn't expected to hold only one project and therefore there's going to be more than one thing to run and you have to choose.
 
Bob Matthews
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tim...........

I wasn't suggesting that you need to read the paper

I was just pointing out that I had a handle on the project aims:-

In simple terms

1) the input data is very straightforward - I have already updated it timewise

2) The first section involves Genetic Programming (GP) - I have not done this before but the approach seems simple enough
The input is (1) and the output is values for a couple of attributes

3) the remainder of the project involves using weka and Autoweka, which is an open-source data mining suite of programs out of Waikato University here in New Zealand
I have used weka before and have written java trading strategies around weka - all running successfully

So, please keep up the encouragement !

I have emailed the authors again, asking if they would consider rebuilding the project using Maven

Kind regards

Bob M
Dunedin
New Zealand
 
Stephan van Hulst
Saloon Keeper
Posts: 13014
281
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It really isn't that hard to convert the project to Maven yourself. Of course, you can wait for the authors to do it for you, but personally I wouldn't be super impressed if I publicized a project as an open source project and people wanted me to convert it because they don't like the format I used to publicize it.

Maven is not that hard to learn. As I pointed out, the quick start and POM reference will get you on your way quickly. It's good for you in the long run as well. I wouldn't hire any Java programmer for anything other than an entry-level job if they didn't know Maven.
 
Bob Matthews
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank Stephan

At 74 yoa, I have probably left my run a bit late to becoming a competent Java programmer....ha....ha.......

However, I shall take it slowly..........

I have downloaded an ebook "Introducing Maven" 2nd edition by Balaji Varanasi and am working my way through the early chapters

Have a good one

Bob
Dunedin
New Zealand
 
When you have exhausted all possibilities, remember this: you haven't - Edison. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic