Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

problem in creating jar

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to make a jar but what I seen after extracting jar there was nothing inside folders.only images are present .I am using my SQL as a database and I am using net beans for it.my project is not over.but I completed some module so want to see it.please help me out what will be the problem.I did exactly the same what youtube video showed me confi n building on clicking hammer like symbol
 
Bartender
Posts: 1280
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you export jar file? With netbeans, when you click Clean An Build or Build icon - yes, that should be the hammer icon - it automatically creates a dist folder where you should find a lib subfolder with all library jars within, a myproject.jar file which includes all your own project classes, and a readme file which tells you how to launch your program with command from your OS shell.
Just try first with a simple project to verify if what I wrote above is right for you - I am not sure but I suppose that behaviour may be overridden by custom settings in netbeans.

 
monisha kasturi
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes the same thing is happening with me there are only folders which i have made in netbeans but when i check it for class files after extracting jar there is nothing inside it.i have attchached jar sir please go through it and let me what should i do,i am really cracked my brain to do so but nothing is working out,you are senoir please let me know how should i over come this sitaution.i have attached the screenshot also of my build config.
1.jpg
[Thumbnail for 1.jpg]
 
monisha kasturi
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ant -f E:\\NetBeansProject\\JavaApplication1 -Dnb.internal.action.name=rebuild clean jar
init:
deps-clean:
Updating property file: E:\NetBeansProject\JavaApplication1\build\built-clean.properties
Deleting directory E:\NetBeansProject\JavaApplication1\build
clean:
init:
deps-jar:
Created dir: E:\NetBeansProject\JavaApplication1\build
Updating property file: E:\NetBeansProject\JavaApplication1\build\built-jar.properties
Created dir: E:\NetBeansProject\JavaApplication1\build\classes
Created dir: E:\NetBeansProject\JavaApplication1\build\empty
Created dir: E:\NetBeansProject\JavaApplication1\build\generated-sources\ap-source-output
Compiling 31 source files to E:\NetBeansProject\JavaApplication1\build\classes
Copying 17 files to E:\NetBeansProject\JavaApplication1\build\classes
Copied 4 empty directories to 2 empty directories under E:\NetBeansProject\JavaApplication1\build\classes
compile:
Created dir: E:\NetBeansProject\JavaApplication1\dist
Copying 1 file to E:\NetBeansProject\JavaApplication1\build
Copy libraries to E:\NetBeansProject\JavaApplication1\dist\lib.
Building jar: E:\NetBeansProject\JavaApplication1\dist\JavaApplication1.jar
To run this application from the command line without Ant, try:
java -jar "E:\NetBeansProject\JavaApplication1\dist\JavaApplication1.jar"
jar:
BUILD SUCCESSFUL (total time: 5 seconds)
 
Claude Moore
Bartender
Posts: 1280
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

monisha kasturi wrote:
To run this application from the command line without Ant, try:
java -jar "E:\NetBeansProject\JavaApplication1\dist\JavaApplication1.jar"


What happens if you try to run your application?
 
monisha kasturi
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sir,
When I am double clicking it nothing is happening in jar how can it work it does not have class files and everything for running this application.
I had given my whole month to complete this project now I am stuck here please give me suggestion sir how can I run it.
Until and unless class files are not coming into my project nothing will happen
 
Marshal
Posts: 25835
69
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Claude Moore wrote:

monisha kasturi wrote:
To run this application from the command line without Ant, try:
java -jar "E:\NetBeansProject\JavaApplication1\dist\JavaApplication1.jar"




The answer to your question "please give me suggestion how can I run it" has been posted several times already. Do take the time to read other people's posts.
 
monisha kasturi
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir i already tried this and nothing is happening,this jar contains only images nothing else
 
Claude Moore
Bartender
Posts: 1280
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At first glance, given elements you provided, I don't see anything wrong with your project. Of course, from a screenshot it's hard - at least for me to guess what really is wrong.
What about if you create another project, a simple helloworld which Netbeans creates from scratch from you, and try to build it ? You should get a working jar.
When you get a workinng jar, i.e a jar that executes your new simple test program by command line, I would verify options one by one to see what are the differences.. if any.
 
Claude Moore
Bartender
Posts: 1280
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Another question: you should find not only a "dist" folder in your project. After build process, you should get a "build" folder with classes subfolder within. Is that right ? How many classes do you find there ?
 
monisha kasturi
Ranch Hand
Posts: 33
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Sir,
I had over come to this problem,the problem is with my layouts some layout is override the properties of netbeans that is why it happened i changed the whole lay out and now i am able to fix it and making jar thatnks for your concern.
 
Claude Moore
Bartender
Posts: 1280
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad you was able to manage your problem...
 
it's a teeny, tiny, wafer thin ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic