Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!

Christian Antfeld

+ Follow
since Oct 31, 2016
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Christian Antfeld


I ran th first of the commands with sudo and without the "Downloads/" portion.  That is my pwd and seems to be giving me trouble when it is added.  

There was no issue when this was ran.  A new blank prompt appeared when the command ran leading me to believe it ran properly.  

I am confused as to why the sudo was required while signed in as root, though.

Is there a way to check if the permissions actually changed on the directory and subdirectories within?  I believe the output of the ls- la command is the set of permissions on the files within based on some readings about Linux or Unix permissions expressions I've seen briefly.

This is the output of the ls -la command:

drwxr-xr-x@  9 root              wheel    288 Nov  3 19:18 .
drwx------+ 34 christianantfeld  staff   1088 Nov  3 19:23 ..
-rw-r--r--@  1 root              wheel  12846 Aug 27 11:09 LICENSE
-rw-r--r--@  1 root              wheel    182 Aug 27 11:09 NOTICE
-rw-r--r--@  1 root              wheel   2533 Aug 27 11:01 README.txt
drwxr-xr-x@  8 root              wheel    256 Nov  3 19:18 bin
drwxr-xr-x@  3 root              wheel     96 Nov  3 19:18 boot
drwxr-xr-x@  5 root              wheel    160 Aug 27 11:01 conf
drwxr-xr-x@ 50 root              wheel   1600 Aug 27 11:09 lib
2 weeks ago
While following this tutorial, at number 4.1 (Adding Maven to the Environment Path), step 2: "Fix the Permissions", I ran the command and all files failed to comply with the chown command.  I followed the instructions verbatim and "Operation not permitted" occurred on all files within the directory.

All steps were followed up to that point including login in as root.  I am not understanding what the -R option does on the command after reading the documentation.  I understand what chown does but not the importance of it applied in this case.  The significance of the entire command on the linked page is beyond me currently and would love to understand it if anyone would like to enlighten me.  

I am at a stand-still with Maven because of this and any help is greatly appreciated.
2 weeks ago
Marshal Ritchie,

You have helped a lot.  What I learned is not to deviate from the tutorial with my limited knowledge of the concepts.  I think I'm going to start over completely and work the tutorial exactly as it says using the $HOME path and have the .java and .class files in the $HOME folder as well.

When I'm finished with it, I'll come back and report on the effects of this.  I appreciate the helpful attention from you and all the others.  I'll be back!
2 weeks ago
Thanks Marshal Ritchie!  The name of the Connector/J is: mysql-connector-java-8.0.18.jar.  I'm not sure what is meant by URL text in the code.  More precisely, which code is being referred to as in Java code or the Terminal command.  The compiled Java class file is in the same folder as the Connector/J.

To show the logic as I understand it:

1. Java class file written and compiled
2. Connector/J invoked with the -cp argument to java runtime tool
3. Java class file invoked and driven by the Connector/J identified in the Terminal argument
4. Output of SQL query or Exception thrown and error message displayed

To me, the error message doesn't make sense to be main method not found if the Connector/J class path is the issue.  Would it not be that the drive is the source of the issue and represented in the error message if it is in fact the problem?
2 weeks ago

Knute Snortum wrote:I just tried to compile and execute your code, and I was able to get it to run.  So your code is not the problem.

* Are you CD'd into the directory with the JDBCTestConnection3.class file?
* While in the directory, do you issue the command java JDBCTestConnection3 ?

1. I'm not sure if I was in the directory with that .class file but I will make sure I am and retry it.

2. No, the tutorial being used instructed "java -cp .:$HOME/path/to/ConnectorJ JDBCTestConnection3" as the Terminal command verbatim.  I am not finding anything within the tutorial or online explaining the -cp argument to the java command either making it more frustrating.

I will try to run the program using "java JDBCTestConnection3" only to see what happens.


I have moved the Connector/J into the same folder as the .class file and run the java JDBCTestConnection3 command and argument. "No suitable driver found for *connection string here*".
2 weeks ago

Campbell Ritchie wrote:So, it appears the class compiled correctly, otherwise you would have had error messages. Please confirm you have that .class file in this location with the dir command (Windows®) or ls (Unix/OSX/Linux).
You probably should have given that class a package name, which you can read about in the Java™ Tutorials, but stick to one problem at a time and don't change anything else until you get your code to run. I presume you have altered the arguments for the connection to keep your details private.

Correct, I changed the details to remain private.  This isn't a big time project or anything but feel it is good practice.  I'm not sure which location you are referring to but the .class file has saved to the same folder as the .java file.

Would a missing package name stop the .class file from running properly?  I would like the main method to run properly but I am left with no direction to work toward.  I'm not seeing anyone say the source code is wrong leading me to believe the code is correct.  I am now stuck at this point.
2 weeks ago

Campbell Ritchie wrote:Did that class compile normally? I so, where is the .class file? Did you give your class a module/package name?

I just ran javac on that file and created a class file from it.  There were no errors expressed in the terminal but this is the first time I've ever compiled a .java file before so I'm not sure if it would have thrown one if the .java file had an error.  No, I have not added a package name.  I think I have been reading very poor resources and do not understand the importance of these things outside of "just do it".

What is the correct protocol for assigning a package name? I have no clue how they work because the readings I've done have either assumed understanding of what packages are by the reader or they just say "this is the package name".
2 weeks ago
I am attempting to set up communication between this Java 8 program and a MySQL instance.  I have changed the identifiers within the Connection String to generalize what I am using for the connection.

When running the program in the Terminal on Mac, I receive a "Could not find or load main class" error.  To my understanding, I have written this properly.

I'm anticipating answers about the Connector/J and Connection String accuracy but getting the main class to be recognized first is the goal.  Feel free to comment or ask questions about the accuracy of the connection channel (Connector/J and Connection String) but the main class error is my focus for the time being.

About the Connection/J Driver:  I am running this through Terminal with the command "java -cp .:$HOME/absolute/path/to/Connector/J JDBCTestConnection3" less the quotes.

Thank you

2 weeks ago
I don't know how I keep making these little mistakes.  Thanks for the help and redirection.
2 years ago
I am following along with the Oracle JavaFX tutorial and I am receiving errors galore.  I believe this is the final one needed to be taken care of before the application will compile properly.  I'm not sure what the compiler requires of me to finish this properly.

With this code I am receiving a "cannot find symbol" error on the FontWeight variable.  Is there a specific import that I need to make outside of javafx.scene.text.font?  Is a FontWeight variable needed in my own code or is it declared in the package/class I wrote in the previous sentence?

Thank you for reading and any help

2 years ago
I believe I have tried that already but I will try it once again later when I get home from work.  If no response, it didn't work.  Thanks for the info though.  I didn't know that wasn't a catch-all for instances like that.
2 years ago
The grid.setPadding method is giving me an error in my program saying that java.awt insets can not be converted to javafx.geometry insets.  I have changed the geometry import to include all of the geometry package by using the .* after geometry but nothing has changed.

I must be missing something.  I am following the Oracle tutorial exactly as it is written but this error persists and causes a compiler error.
2 years ago
Thanks!  I don't see how I couldn't figure that out myself based on context.  You are right on the money too (an infograph describing the concept was just under where I was reading on the Oracle site).
2 years ago
I am learning the JavaFX UI stuff right now and I am not seeing what the Hgap and Vgap are used for.  I do not need an in depth explanation. I prefer to put the pieces together on my own really.  Sorry if this is coming across as rude but when things are just handed to me I do not learn as well as when I have to think about how things fit together.

Thank you for reading and for any help I might receive.
2 years ago