Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
James Sabre wrote:Phew - that is very hard to read.
List the content of your jar file using
jar -tf your-jar.jar
Then extract the manifest using
jar -xf your-jar.jar META-INF/MANIFEST.MF
Post the jar listing and the content of MANIFEST.MF.
Campbell Ritchie wrote:Welcome to the Ranch
Jo Young wrote:
I am not using cmd I am using JDeveloper.
I tried using cmd to do this and I got this:
'jar' is not recognized as an internal or external command,
operable program or batch file.
and I tried looking around to try to find a jar.exe file or something that I could point to and call the command that way and it doesnt exist anywhere on my computer. I found a whole range of java.exe (java.exe, javax.exe, etc) in the JRE directory and in the C:\Windows\System32 directory just as expected but no jar.exe
however JDev is so kind as to give me a jar listing after it deploys the jar... it says
META-INF/MANAFEST.MF
myTimer.class
timer/myTimer.class
........ wait a second... why does it have manifest.mf instead of the manifest that I wrote myTimer.mf? hmm... my problem may be solved lol at least the problem of the class not working... still cant use the jar command.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
James Sabre wrote:
Jo Young wrote:
and I tried looking around to try to find a jar.exe file or something that I could point to and call the command that way and it doesnt exist anywhere on my computer. I found a whole range of java.exe (java.exe, javax.exe, etc) in the JRE directory and in the C:\Windows\System32 directory just as expected but no jar.exe
however JDev is so kind as to give me a jar listing after it deploys the jar... it says
META-INF/MANAFEST.MF
myTimer.class
timer/myTimer.class
........ wait a second... why does it have manifest.mf instead of the manifest that I wrote myTimer.mf? hmm... my problem may be solved lol at least the problem of the class not working... still cant use the jar command.
I could be wrong but I don't think that in JDeveloper you have to explicitly create the manifest.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Use the same number as the version number you got from -version. You might need quotes "" around that lst instruction if it contains spaces.javac -version
javac 1.6.0_22
C:\\Program Files\java\jdk1.6.0_22\bin\jar -version
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
"If the facts don't fit the theory, get new facts" --Albert Einstein
Hunter McMillen wrote:I am not familiar with JDeveloper, I use a really simple IDE called JGrasp, that has built in support for creating .jar files. You could give that a try if you like, thats me ~30 secs to make a .jar file.
http://www.jgrasp.org/
Hunter
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Jo Young wrote:"Could not find the main class: timer.myTimer. Program will exit"
Jo Young wrote:Main-Class: Timer.myTimer
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
James Sabre wrote:So why don't you no do as I suggested in my first reply. i.e. List the jar content index and the content of the manifest. Given these almost anybody here will be able to say exactly what is wrong.
Make your you list the content of the manifest file that is in your jar file.
James Sabre wrote: Every Java development IDE I have worked with has the ability to create executable jar files. JDeveloper certainly does. The problem is not the IDE and I don't think that pushing the OP towards a different IDE is going to help him at all. If anything i would suggest that he OP throw away his IDE and use a text editor and the command line. That way he would understand what JDeveloper is doing behind the scenes to make it easy for him.
Rob Spoor wrote:
Jo Young wrote:"Could not find the main class: timer.myTimer. Program will exit"
Jo Young wrote:Main-Class: Timer.myTimer
You are aware that Java is case sensitive, aren't you? timer.myTimer is not the same as Timer.myTimer.
Also, does your manifest file end with a line break? Because practice has shown that without an ending line break the manifest won't be read properly in some cases.
Jo Young wrote:[
C:\JarFile>C:\oracle\Middleware1013\jdk160_18\bin\jar -tf myTimer.jar
META-INF/
META-INF/MANIFEST.MF
myTimer.class
C:\JarFile>C:\oracle\Middleware1013\jdk160_18\bin\jar -xf myTimer.jar META-INF/MANIFEST.MF
<nothing>
I tried it with Manifest.txt Manifest.mf and myTimer.mf all of which contain:
Manifest-Version: 1.0
Main-Class: Timer.myTimer
every time, nothing in the manifest.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Campbell Ritchie wrote:If your most recent JDK is 1.6.0_18, you might do well to download and reinstall it. You will doubtless remember you can find it here. You should find a link to the installation instructions in that "common problems" page I told you about earlier. It is quite easy except §4 about setting the PATH.
I would have thought your IDE would have added the new line to the mainfest file automatically.
James Sabre wrote:
You don't need to create an explicit manifest. JDeveloper allows you to specify a deployment profile in which you just select the class to use as the main class. It then automatically creates a jar file with an appropriate manifest.
You need to spend some time learning about how JDeveloper works.
Campbell Ritchie wrote:You're welcome
The 1.6.0_18 update is getting on for a year old; update no 25 came out a few weeks ago.
I appear to be a little out there.
Apparently there is now a no 26. I looked up this Wikipedia page where it says update 18 came out in January last year.
Get me the mayor's office! I need to tell him about this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
|