Netbeans Make Executable Jar Resource
Find Netbeans Make Executable Jar
1 Netbeans Make Executable Jar Loading
2 Netbeans Make Executable Jar Loading
3 Netbeans Make Executable Jar Loading
4 Netbeans Make Executable Jar Loading
5 Netbeans Make Executable Jar Loading
6 Netbeans Make Executable Jar Loading
Best Answers
How do i start my executable jar file without having to open netbeans? My application is a database desktop application. The jar file works fine if i connect the database from Services from netbeans. I want to be able to open the jar file without opening netbeans and doing all that. I can start the derby network server from command line and it is giving the message: Security manager installed using the Basic server security policy. Apache Derby Network Server - 10.4.2.1 - (706043) started and ready to accept connections on port 1527 at 2009-09-10 08:52:00.296 GMT But i still don't know what to do after that. How do i make the database application executable?! Any help is appreciated. Thanks in advance. No it is not working.. Exception in thread "main" java.lang.NoClassDefFoundError: DriverLog/jar Caused by: java.lang.ClassNotFoundException: DriverLog.jar at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Could not find the main class: DriverLog.jar. Program will exit. CORRECTION!!! java -jar DriverLog.jar [TopLink Info]: 2009.09.10 10:43:00.468--ServerSession(2989062)--TopLink, versio n: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007)) Sep 10, 2009 10:43:01 AM org.jdesktop.application.Application$1 run SEVERE: Application class driverlog.DriverLogApp failed to launch Local Exception Stack: Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/ 06/2007))): oracle.toplink.essentials.exceptions.DatabaseException Internal Exception: java.sql.SQLNonTransientConnectionException: The connection was refused because the database driverLogBook was not found.

Seigneur A replied: "does java -jar filename.jar from command prompt work?"

deonejuan replied: "[ see link below ] this is a classpath thingy... Having said that, then I have many hours invested packing the .jar correctly. NetBeans does this pretty well. Trying to pack a jar manually is insanity. In NetBeans, select the project, Menu File --> SetMainProject >> You want the class with the main() specified. Then it is Build Final and that will put the .jar inside of a new folder called dist. You may also have to Menu Build --> Set Main Project Configuration. Invoking that menu gives you several tab panes to set options. After it is all said and done, the .jar file will have a Manifest file that points to main() and can also include optional runtime instructions. It is impossible to manually edit the Manifest file (otherwise a malicious instruction set would be trivial). In a Win box, at the desktop, a double-click of the .jar icon starts your gift to the database community in the wilds. In Linux, it is a Terminal or a Shell that spawns the launch with java -jar MySpiffy."

How do I create a linux executable from a java .jar file? Hi, I've just started learning Java, and I wanted to know how I would turn a .jar file (created by NetBeans) into an executable for linux. Is this even possible?

Robert M replied: "ive done Java a bit, more C++, but I still did a bit of Java. I havent done NetBeans in a while, but if I remeber right, this is on the Linux version if there is a difference, you have to go to File > Run Program, and than it should run. But if thats not what you want go to the command line ~$ chmod a+x foo.jar of course you'd want to replace foo.jar with the name of the file. the chmod a+x will add the executable bit to the file and than you can execute it. It may not work, but its worth a shot. If that doesnt work than use the same command except replace a+x with a-x and that will remove the executable bit."

Jason R replied: "I've heard of converting a .jar file to a .exe file, but not into a Linux executable. Either way, even if you could, the process would be dulling and not worth it. Java was designed to be multi-platform and converting it to an executable for a specific OS strips its only real perk away. Not to mention, you'd basically have to pack the whole VM into the executable for it to work, which creates HUGE overhead. .jar files can be executed like any other executable as long as the JRE is installed on that system, so I wouldn't really see an advantage to doing what you want to do. Sorry I didn't answer your question, but hopefully my response will make you reconsider."

Milt15 replied: "to launch a .jar file just type in the terminal java -jar path/prog.jar you may even create a launcher for it just put the launching command in the launcher don't forget to use sudo (if you are using ubuntu or ubutnu based ) or su if your program needs administrative privileges"

VS replied: "Doing a chmod is really not going to do anything (in case you were thinking of doing a 755 or something). Jar files or class files for that matter, need a java executable. You simply need to type java ...options.... myClassFile or java -jar ...other options.... myJarFile.jar (assuming a main-class is defined) or java -cp myJarFile.jar:otherJarFiles ..other options.. myClassFile Hope this helps."

deonejuan replied: "It takes a shell if you want to set it up like MS s. I would type such a for you but there are several variables like if you are linking external libraries or hardware devices. But, let us suppose you were able to set up the Project correctly in NetBeans; you told the build config where the main() is in your project; and finally let's suppose you told NetBeans to Build Final. Inside the dist folder of the project will be a little icon with .jar on the end. If you open up the ReadMe text file, there will be an instruciton like: "To run this here Whizbang.jar you might wanna: java -jar Whizbang.jar [return] remember, the JDK is an acronymn for Java Development Kit. If you want any further OS and Desktop icon functionality we must move the efforts outside java."

Netbeans.. Error in deploying jar file in my friends computer? I use Netbeans 6.5 I created a "Java Desktop Application". Project name is httpget. I completed the coding. I needed an executable JAR file.. So i build the project and got my .jar file.. In the httpget\dist folder, the following files are found httpget.jar readme.txt lib\appframework-1.0.3.jar lib\swing-worker-1.1.jar when i double click the httpget.jar file, my application worked perfectly.. but i wanted to send this app to my friend.. So i added to folder to dist.zip and mailed him.. after he extracted, he ran the jar file with following commands java -jar httpget.jar But he got the following errors Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/swi ng/GroupLayout$Group at httpget.HttpgetApp.startup(HttpgetApp.java:19) at org.jdesktop.application.Application$1.run(Application.java:171) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) He has installed JRE.. He has also added the classpath to the two jar files under the lib folder.. what he should do to run this app successfully? (i tried jsmooth to obtain exe file from the above jar file, but it also failed)

deonejuan replied: "Make sure your project is set to Main Project in NetBeans (the name will be bold in the projects tree). Then Set Main Configuration on the Build Menu, go into Custom, don't use default. Tell it where exactly your main method is by browsing. This will write the Manifest for the jar correctly. (You can java -jar MySpiffy.spiffy.main, but you might mistype the folder structure). Note that any images need to be in the class build structure of files. Note you can read a text file within a .jar but never write to a text file. And the reason it works in NetBeans is Netbeans keeps a database of all the pathnames it needs. Outside the IDE, and java JRE works on the concepts of CWD -- Current Working Directory -- what you CD into."

Now replied: "Learn how to Fix Computer Errors:"

How do i run my .Jar files that i made in NetBeans? I built the project and got the .Jar file executable java file. I heard that you need JRE (java run time environment) to execute them. I got the JRE and when i double click on my java program, it does not do anything. I have been trying forever to get this working. i tried the CMD way (java -jar *name*) that did not work. I dont know how to make my java app work. I worked hard on my project to find out of that i cant use it (only in the IDE) it will let me use it. Please help me. thanks

modulo_function replied: "The best thing to do is use the command prompt and get yourself into the save directory as the jar file. THEN you can use: java -jar "name" to get to the directory: get the command open use dir to get a listing of files there use cd to change directories if your directory name has a space in it then you will need to put the name within quotation marks."

More Sites
Popular Tags
Netbeans Make Executable Jar © 2009


Report Abuse to: abuse(at)hostaim.com