• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Errors While Compiling Classes (Oracle JDBC Tutorial)

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While following the Oracle JDBC tutorial, I made it to the step after changing the build.xml file and corresponding javadb properties and mysql properties files as described in the tutorial.

There were multiple specific errors during compilation and one warning:

Errors: 34 (8 of these) and 36 (two of these)
Warning: regarding a deprecated Object class method called finalize()

Error 34 and 36 both give similar issues mentioning com.sun.rowset not being visible.  Being new to using the jar command, another message directly below the warning says things like "import com.sun.rowset.WebRowSetImpl;".  I'm not sure if this has to do with access levels like public, protected, and private or if visible means something else in the context of the javac tool.  

I could not figure out how to attach an image to show the messages.  Here is one example of the error messages (all of which are nearly identical with different things not being visible):

[javac]   (package com.sun.rowset is declared in module java.sql.rowset, which does not export it)
   [javac] C:\Users\antfe\Downloads\JDBCTutorial\JDBCTutorial\src\com\oracle\tutorial\jdbc\WebRowSetSample.java:36: error: package com.sun.rowset is not visible
   [javac] import com.sun.rowset.WebRowSetImpl;


Link to Oracle JDBC Tutorial (CTRL-F: Compile and Package the Samples to jump to it): Oracle JDBC Tutorial  


 
Saloon Keeper
Posts: 15727
368
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any tutorial that uses Ant is extremely outdated.

You're getting this problem because you're on a new Java version that packages the standard API as Jigsaw modules, and com.sun.rowset is an internal package that is not meant for public consumption. Plainly put, the tutorial is not only outdated, it is also badly written.
 
Marshal
Posts: 79956
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I never thought the Java™ Tutorials used Ant in the first place. Those Tutorials haven't been updated since Java8.
 
Christian Antfeld
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm getting the feeling I ought to drop the Ant tutorial and go with Maven and/or Gradle.

Is Ant used at all in industry or by anyone for that matter?  It seems to be a dead or nearly dead technology but others say its used when searching online.  
 
Saloon Keeper
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's probably still used in many places for legacy projects that didn't have a need to update to Maven or Gradle. But anything new should be done with those two, preferable Gradle (although many tutorials may still use Maven).
 
Christian Antfeld
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim.  One last question about this:  I've read a number of comments and maybe an article or two that all mention a similar thing: "knowing technology X, even though it seems to be outdated, is helpful in learning technology Y" given that the two either serve a similar purpose or do essentially the same thing as Ant, Maven, and Gradle all facilitate the development process.

Would I be missing anything by not learning Ant outside of the concept of another tool doing the building and managing of the overall project?  I'm still a little early into understanding the ways Ant, Maven, and Gradle all help with managing larger projects.  To me, they all seem to simplify the process of the overall build of Java and some other languages.  I'm a little lost in the jargon but feel I have the basic picture figured out
 
Campbell Ritchie
Marshal
Posts: 79956
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please give us more details about that quote. I suspect it doesn't mean, “Learn X as well as Y even if you are only using Y,” but, “Since you used X before, you will find Y easier to learn now X is no longer in common use.”
 
Tim Moores
Saloon Keeper
Posts: 7645
178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sure, knowing Ant would provide you extra perspective on how a build process can work. But using XML to describe a process -and if you're customizing your build it's more like a program- is not ideal. Maven also suffers from this.

What both Maven and Gradle do that Ant doesn't is dependency management. Just about any project has many of those these days, and Ant has no concept of that, basically leaving you to gather dependencies as jar files in a lib directory, which makes updates a pain. You can work around that with Apache Ivy, but it's more straightforward to use a tool that can do this natively. Another difference is that Ant gives you much latitude how to organize your files, whereas Maven and Gradle pretty much prescribe where everything needs to be. The benefit of that is that its much easier for others to work on a project, as all Maven/Gradle projects organize their files the same way.

So the short of it is: Use Maven or Gradle for dependency management. Use Gradle for its non-XML syntax and easy extensibility using Groovy.
 
please buy my thing and then I'll have more money:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic