Yes those are examples of packages.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Yes those are examples of packages.
javapenguin (June 15th, 2010)
So what would I call mine? I'm importing more than one of those package types I just mentioned in the last post.
I just called it Battleship, but it didn't like it.
Does package name have to be the same as class name?
I entered:
jar cfm Battleship.jar manifest.txt Battleship/*.class
into command prompt but it didn't like it.
said that it isn't recognized as a command, bla bla bla.
entering command where? In command prompt?HTML Code:We then create a JAR file named MyJar.jar by entering the following command: jar cfm MyJar.jar Manifest.txt MyPackage/*.class
jar cf bob.jar BattleshipGUI.class BattleshipGUI$1.class BattleshipGUI$QuitButtonHandler.class BattleshipGUI$SurrenderButtonHandler.class MyTooSmallException.class MyTooBigException.class
That won't work either.
Have you considered the NetBeans, Eclipse, or Intellij IDEA IDE's? They do this all for you. Knowing how to make a JAR file by hand is not a requirement for a Java developer, although it does come in handy.
If you don't want to use an IDE, try this: Use ANT to Build a JAR with version/build number - Real's Java How-to
javapenguin (June 15th, 2010)
That message is from the OS. It is saying that it does not know/recognize the command you entered.isn't recognized as a command
Where is the file for the command located? Is that location on the path?
Can you use the full path to the command to execute it?
For example: c:\Program Files\java\bin\jar.exe ...
javapenguin (June 15th, 2010)
Yes I could put it in Eclipse. Already have one in there, and all I would have to do would be to modify it.
However, is there a way directly from Eclipse to make it do all of this very time consuming work for me? I've already tried a lot of the day.
I think I have Eclipse SDK, not JRE or IDE or whatever it's called. I think I might have JRE, but not Eclipse IDE. Maybe it comes with.
Ok, I finally got it to work. However, how do you get that evil Eclipse program to do that with programs that have println and are not just GUI?
Is it possible to add a JMenu to the top of a JFrame?
Perhaps not, but I can add one to a JFrame. I just did.