Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!

A Diamond

Greenhorn
+ Follow
since Feb 06, 2020
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
1
Total given
4
Given in last 30 days
4
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by A Diamond

You've given me some food for thought! I'm going to play with the enums a bit more.
2 weeks ago
Sure. I didn't download any extra jars, but I'm assuming the IDE did, using the Maven info that I plugged in above.
2 weeks ago
I added a library dependency to my Maven project. So in my POM, I added:



I then utilized a single function:

When I run the code in the IDE, it runs just fine, no errors, and makes the names I feed it uppercase (first letter), just like I want it to.  However, when I run it from the command prompt:

java -jar IntoTheVoid.jar
...when I get to the code that capitalizes the word:



Why would it run fine in the IDE, but not from the JAR?
2 weeks ago
Oh, ha, ya, I was going to add them all. Wanted to get just one working first ;)
2 weeks ago
That was it, thank you!
2 weeks ago


I'm struggling with using enums. You can see my code above. In displayMap, I'm trying to do a switch on the value of galaxyMap[x][y] which should be an enum value. However, I can't seem to wrap my mind around how to get this to work with a switch statement.
2 weeks ago
I'm playing with Java, and struggling with the IDE. I have nothing more than a simple HelloWorld Maven app. I instructed the configuration to build a jar artifact when I run it. The app runs fine in the ide, "Hello World!". When I try to run the jar from the command line, however, I get:

andrew@andrew-satellite:~/IdeaProjects/HelloWorld/out/artifacts/HelloWorld_jar$ java -jar HelloWorld.jar
no main manifest attribute, in HelloWorld.jar

My manifest:

Manifest-Version: 1.0
Main-Class: com.gmail.myemail.Main

My Main.class:

package com.gmail.myemail;

public class Main {
   public static void main(String[] args) {
       System.out.println("Hello World!");
   }
}

What have I done wrong here?
2 weeks ago