Jump to content

Creating a JAR

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
domestic

domestic

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
Ok. Heres my problem:

I have used BlueJ and messed with NetBeans - BlueJ Edition 5.0, however neither can succesfully create a working JAR for me. Basically i THINK the problem is the MANIFEST.MF file but truelly I am unsure. What I am trying to do, and can do inside a program like BlueJ or NetBeans - BJ ED, is create a program which calculates TAKT time. The workings are unimportant but I want to create a user interface. NetBeans has a fantastic drap and drop ability similar to that of VB6 which I love. However, I can't get it to work properly in a JAR file. I believe I should be placing the code to call this window in the method: public static void main(String[] args) {}. But despite my efforts, I have achieved nothing but more errors than Vista at first release. So I decided I can't get it to work in BlueJ (except inside the program when I run the "Driver" file which I use to run everything), NetBeans BJ-Ed and NetBeans IDE 5.5 (which I dabled with) fail, so heck lets try something else - Eclipse. Only it has a bigger problem! I downloaded and it looks great. From the start I wa happy. Tutorials > SWT - create a program to display a window with "Hello World!" in it. FANTASTIC I thought. But no! ITS TUTORIAL CANT CREATE THE PROGRAM!!!! It comes up with these errors:

Display cannot be resolved to a type
Display cannot be resolved to a type
Shell cannot be resolved to a type
Shell cannot be resolved to a type

COME ON!!! WHAT IS IT WITH BAD TUTORIALS!!! NETBEANS BJ-Ed was the same for certain things.

So this is a huge call to say:

HELP PLEASE!!!

I just need to use ANY PROGRAM!!! to create a JAR which 1: Works and 2: Displays a GUI for a user.

Thank you. Im off to go cry in a corner now and give my laptop "that look".

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
I can tell you with 100% confidence the Sun "Hello World" tutorial isn't "bad," but perhaps your system is. I would reccomend uninstalling Java and your IDE's and starting fresh. Have you looked at any of the tutorials I've written for these forums?

http://forum.codecal...rial-index.html

The first two should be of interest to you. They go through installing Java and Eclipse. The second one gives you a VERY basic Hello World GUI. Once you have the application up and running, you just right click on the package, go to Export then save it as a JAR.

#3
domestic

domestic

    Learning Programmer

  • Members
  • PipPipPip
  • 44 posts
My apologies. I was refering to the tutorial for NetBeans BlueJ Ed. They tell you to create a BlueJ java app yet they themselves (as seen in the images) create a NetBeans IDE app and as such they tell you to do things that can be done to IDE apps but not BlueJ apps. My mistake for failing to make my meaning clean. Sorry. And I'll try all the tutorials here. What program do you use? Eclipse?

#4
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Yep, eclipse is the best :)