Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Jar Bundler Problems

Hi, I'm learning Java and I have my own application. It works perfectly when I open the jarfile, but when I use Jar Bundler to convert it to an app, it quits before it opens. The icon appears in the Dock and then disappears. Also, when I try to choose "Main class" the file never appears after I choose it. Does anyone know how to fix this or any other alternatives? Thanks.

Posted on Apr 28, 2013 2:38 AM

Reply
59 replies

May 5, 2013 7:17 AM in response to etresoft

Sorry, I don't follow. My Jar Bundler app no longer saves the path of the jarfile i select with the "choose" button when choosing the main class. I typed the path myself (that might be the problem) and when I created the application, it appears in my Finder. But when I run it, the icon appears briefly in the Dock and disappears. I mean VERY briefly.

May 5, 2013 9:52 AM in response to Arc676

Run Console and see what it says when you launch your app.


When you run any Java program, you will need some environment variables setup. The most important one is CLASSPATH. That is going to be defined in Xcode and in a shell environment, but not in your app when launched from the Finder. You would have a main program that sets the CLASSPATH environment variable to the path to the path to the jar file inside your application's bundle and then run Java with that jar file. That is primarily what the Jar Bundler does. I'm not familiar with it. The documentation says it is legacy. It may not work anymore. You could still do it by hand if you really wanted to write Java programs.

May 6, 2013 3:06 AM in response to etresoft

I opened it and this is what it said on Console:

5/6/13 6:05:02.525 PM Dock[394]: no information back from LS about running process

5/6/13 6:05:02.647 PM com.apple.launchd.peruser.501[171]: ([0x0-0x56056]./users/MY_USERNAME/documents/eclipse/MY APP NAME FOLDER/APP.jar[452]) Exited with code: 1


I put the usernames and names of folders in all caps.

May 17, 2013 3:13 AM in response to Arc676

Hello? It's been a week since anyone posted anything here. I really need help with this, and I might as well post some more info. I have another project with the main class in the default package, and that's the only class in the app. When I choose the jar file of that app the name of the class appears in the text box. However, even though I set the main class for the jar file as a class in the default package, it doesn't appear. Anyone knows anything about this? Please?

May 17, 2013 4:20 AM in response to Arc676

Sorry, but I lost interest. I started writing a demo project but then came to my senses and got back to my own work.


It isn't 1997 anymore. Java has been exposed as a world-class hack-job that is the malware author's dream and that only enterprise IT could have ever loved. There is no logical reason for a normal person to be using Java on a Mac.


If Apple's old JarBundler is no longer working, then you will have to do it manually. Create a JAR file using "run build script" in Xcode. copy it to your application bundle. In your Objective C main, set CLASSPATH to the path to the JAR file in your application's bundle, then exec java with your class name. This will give you the world's ugliest Mac application that launches with a double-click from the Finder.


Ultimately you have to decide what you really want to do. If you want to be a Java programmer then you need to use Windows and take the enterprise IT route. The market is tight for enterprise Java programmers because such jobs are typically outsourced to India. There, a top-notch Java programmer can make a few thousand dollars a year. You can take the Android route and use Linux. No doubt all of those smartphone buyers too cheap to buy an iPhone will want to use those dozens of dollars they save by purchasing your app. In neither case will you ever need to run those Java programs on your Mac.

May 17, 2013 6:16 AM in response to Arc676

Arc676 wrote:


Are you suggesting I should give up Java?

I can only speak for myself. Java will not be part of my future. I work in an enterprise (government) environment so I deal with Java every day. It is a capable enough language but it was never well integrated into any operating system. Android might be the exception, but some claim that Google acted illegally to do that.


In my experience, it isn't the Java language but the Java programmers that give it a bad name. I have seen Java programmers throw up their hands in defeat because some minor 3rd party library (open source, no less) needed a maintenance update. I have seen other Java programmers code their own byte-swapping code becaues they were unaware (even after I told them) that Java already did that. My current Java programmer pet-peeve are people who don't seem to know about multiplexed I/O (even after I told them) and keep writing Java apps that take 100% of the CPU with spin loops. I have seen a few clever and interesting Java programs, but they were either pure server apps or pure graphic apps.


The world I have just described is the enterprise IT world. Because this is government work, it is somewhat immune to the offshoring phenomena. I can't imagine offshore Java programmers would have any more incentive to do good work by being paid 10% of what my colleages make. Is that what you want your future to be?


I know virtually nothing about the Android world but it does seem more interesting and open to rewarding work than enterprise IT.


I don't see any point or future in anyone writing Jar-bundled Mac apps. If you were taking Java in school or something, then it would be a valuable exercise and I would be much more interested in helping. You would not need to write any Jar-bundled Mac apps in that domain either. If you want to do it just for fun and to learn, then that's fine. I will be happy to tell you how to do it, but I just can't bring myself to write a demo or User Tip. Instead of Java, you could do the same kind of thing by writing a web app that runs (virtually) entirely in HTML and Javascript. Such an app would be sellable in the App Store and would be indistinguishable from a real iOS app. But Java just isn't interesting.

May 17, 2013 7:06 AM in response to Arc676

I know of no websites that are good places to learn anything. If you want to learn how to program, go to school. You may very well learn Java in school but that is fine in a learning context. Once you have enough experience you will be able to learn things on your own. Lacking that basic experience, you will have a very difficult time no matter what direction you take. We all needed hand-holding to start.

May 19, 2013 6:53 AM in response to Arc676

It isn't that I don't like one language or other. I just think that languages are appropriate in only specific contexts. Using the wrong language in the wrong context is just going to be painful. That is true for Java, C++ and just about anything else.


Java was heavily marketed as the end-all, be-all, platform-independent, write-once-run-anywhere, safe-web-browsing language. It failed miserably on all of those fronts. There are a few applications where Java is a very good choice. We had a satellite simulator written in Java that was very impressive. It was many times better than the older generation. Back in 2002 I saw Java running in an embedded environment with a custom graphical display (video poker machine) and that was an excellent application. Obviously the Android folks saw Java's potential in that environment too. Those are the exceptions, however. Usually when I see someone doing something in Java, it is just a mess.


C++'s problem is that it is just way too hard to do right. It has virtually no low-level architecture support for things that software actually needs to do. It turns out that those things are quite hard to do well. Then people build these huge systems on C++ founded upon a very flaky layer sitting between the operating system and application logic. C++ is kind of schizophrenic too. People use it as an object-oriented language but it just doesn't have the runtime support for that. It is better as a generic, template language but such code is virtually impossible to write.


Unfortunately, both Java and C++ have been used a teaching languages to the detriment of new programmers, the industry, and pretty much everyone. They are both exceptionally bad at that. I was in the last generation to learn with a language designed to be used as a teaching language - Pascal. Apple was one of the few companies to use Pascal for a real application. Writing Windows apps with Borland's Delphi compiler (object Pascal) was a dream.


People who use Java in an enterprise environment do so because Java runs on Windows, maximizes billable hours, is easy to write, and has an unimaginable amount of libraries. People who use C++ do so to prove how smart they are. That is why C++ is gaining new favour in universities because it helps to weed out people. I was once in that camp and was very proud of my C++ prowess but I finally figured out that I was only wasting my time.


For all it's faults, C is still the best general purpose language for learning and doing real world. Apple's Objective-C adds object-oriented logic to write complex, GUI software. Objective-c isn't appropriate for all tasks. Perl, JavaScript, PHP, and XSL are other languages that I like and use on a regular basis. Each is good for some tasks but not others. The problem is that when people are first learning, they want to learn fast and have an app in six months. That just isn't going to happen. In technical complexity, software development is one of the most difficult jobs people do. You can learn brain surgery in six months too, but it will be messy.

May 19, 2013 1:03 PM in response to etresoft

JAVA is no problem at all, it's even used on mainframes.

It is a much safer language than C (which I have used over 25 years).

The problem is JAVA deployed in web browsers.

Nobody will hack your JAVA application.


Now, my question to you: where did you get that JarBundler?

I started Mountain Lion, loaded both APPLE's JAVA and ORACLE's,

but I can't find that tool anywhere.

;JOOP!

Jar Bundler Problems

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.