Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!

Gerard Gauthier

Ranch Hand
+ Follow
since Mar 19, 2019
Gerard likes ...
Monad Java Linux
Cows and Likes
Cows
Total received
1
In last 30 days
0
Total given
0
Likes
Total received
18
Received in last 30 days
4
Total given
14
Given in last 30 days
7
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gerard Gauthier

Paul Clapham wrote:Nitpick:

Gerard Gauthier wrote:This question is aimed at Java programmers who have experience with the language...



But "greenhorns" are "beginners", so your question wasn't aimed at them.



Yes question wasn't aimed at them but the answers were.
1 hour ago

Stephan van Hulst wrote:What's wrong with the Maven in 5 Minutes guide and the Getting Started guide?



There is nothing wring with them. I learned plenty but they start with mvn archetype:generate.... and as you said you can start you projects from scratch or without calling a prebuilt archetype.
14 hours ago
I'm new to Java but I'm not new to programming and I'm wondering what areas of Java programming do rookie Java programmers tend to overlook or not give enough attention to?

This question is aimed at Java programmers who have experience with the language and writing real Java programs.Hopefully the answer will help us rookies on certain overlooked topics.

If I had to choose one area that surprised me with its lack of coverage in the intro materials -> the class path. I'm surprised how much(implicitly and explicitly) class path shows up in real java programs. Its everywhere but intro materials don't really emphasize its importance.


14 hours ago

Stephan van Hulst wrote:I don't know what the purpose of the archetype is. When I looked at the directory structure it generates it seems pretty useless to me.

I never really use archetypes. I suggest you learn the Maven POM reference and set up your projects manually. It's not very difficult.



I started doing some introductory reading on how Maven expects directories and files to be set up... And you are right. It's not very difficult to set up your own projects but it is very tedious and takes a lot of reading.

I'm surprised they(Apache Maven) don't have a Maven tutorial called from the ground up -> Building your own Maven projects <-.  
17 hours ago

Monica Shiralkar wrote:

Gerard Gauthier wrote: areas of memory that can hold data.



What does areas of memory that can hold data mean. Even a string is also an area of memory that can hold data.



And a string is a data structure. A integer is a data structure.
1 day ago
Data structures are pretty much the same across languages.. They are(in the simplest terms) areas of memory that can hold data.
1 day ago

Stephan van Hulst wrote:I don't know what the purpose of the archetype is. When I looked at the directory structure it generates it seems pretty useless to me.

I never really use archetypes. I suggest you learn the Maven POM reference and set up your projects manually. It's not very difficult.



Well I'm very new to Maven and its a little overwhelming right now... Maybe when I get a little traction in the topic.

BTW. The posted dependency worked. I dropped the war file into my tomcat server and it worked.
2 days ago
I hate to be that guy but....

Isn't the whole purpose of this web-app to compile and generate Java servlets and jsp's? You'd think that dependency would be a default.

Sorry for the gripes. Thanks for the help.
2 days ago
Here's the the pom.xml

2 days ago
Now its just a pile of errors when I call mvn package.



dir tree


What's wrong now? Do I have to add a class path or does this maven project know how to compile a servlet?
2 days ago
I'm using this site's example to build simple Maven webapp project:

https://maven.apache.org/archetypes/maven-archetype-webapp/

Now the above works but I want to add a servlet off the WEB-INF/classes folder and have that included in the war file. It doesn't compile the servlet and I have no idea why.

Here's my dir tree after I call mvn package



As you can see the MyHelloWorld.java did not compile and its the same in the Demo.war. Any pointers?
2 days ago
I'm just wondering if anyone has tried VS Code's Java plugin? It supports Maven too.

I used it(VS Code + Java plugin) but I didn't realize it also supports Maven too.

https://code.visualstudio.com/

Has anyone tried Maven with VS Code?
3 days ago

Rob Spoor wrote:... Just remember that any project using the dependency cannot be built by others that don't have the dependency.



So basically(since the dependency is local) I can only build I it on my machine. Right?

I kind of figured out how dependencies work by exploring my ~/.m2 folder and the pom.xml's dependency section.



I just walked into my ./m2 folder using the tags for junit as steps.
4 days ago
I just created a SnapShot and installed it on my local repository and now what? I can see it in my ~/.m2/repository folder but how do I use in my next maven project?

I want to call mvn archetype:generate and use my new SnapShot there but I'm not sure how to add it and import it into App.java.

Need some simple guidance. Hopefully simple.
5 days ago
Thanks Paul, I went with Files.copy(Path, OutputStream). And yes I agree that the library method should handle all the details of a simple operation like move all these bytes from here to there..
5 days ago