Home » Newcomers » Newcomers » How do I run a .JAR file from the terminal?(Ubuntu 12.10 32 bit .JAR file wont execute from command line)
|
Re: How do I run a .JAR file from the terminal? [message #1016860 is a reply to message #1016855] |
Thu, 07 March 2013 22:58 |
|
On 3/7/2013 3:27 PM, Hugh Foster wrote:
> I got a error when I tried to run a java file from the terminal sayiing,
> "unrecognised option"
> Error: Could not create the Java Virtual Machine.
> Error: A fatal exception has occurred. Program will exit
Need a bit more information.
(Don't count on previous threads with different names or a running
conversation with anyone to supply it--I do know you were wanting to
execute your new Java program from the command line, but others may not.)
What OS?
It's not a Java file (.java), but a JAR (.jar) file, right?
What's the command you used to execute it at the command line?
Did you create a "runnable" JAR?
|
|
| | |
Re: How do I run a .JAR file from the terminal? [message #1016864 is a reply to message #1016861] |
Thu, 07 March 2013 23:18 |
|
On 3/7/2013 4:09 PM, Hugh Foster wrote:
> OS is Ubuntu 12.10. and yes I did create a runnable jar file.... I think
> I have to crreate an instance of the class and create a manifiest file??
But, it's the command line that's troubled, you said.
java -jar project-name.jar
Which option was unrecognised?
As for MANIFEST.MF, I create JARs using ant as my builds must be
reproduceable without Eclipse present. It's been too long since I
created one using Eclipse. I looked for links using "eclipse make
runnable jar". Some were wrong and others moronic. This discussion looks
promising, though:
http://www.coderanch.com/t/556622/vc/Create-Runnable-JAR-File-Eclipse
|
|
| | | | | |
Re: How do I run a .JAR file from the terminal? [message #1016875 is a reply to message #1016870] |
Fri, 08 March 2013 01:19 |
|
On 3/7/2013 5:46 PM, Hugh Foster wrote:
> lightning@rigel5:~$ java -cp
> temp.jar.lightning.java.hello.MyFirstClass I typed this in and got a
> java command usage index and did not display the file.
Of course, at this point, you're outside this forum and in the realm of
javaranch.com or stackoverflow.com.
|
|
| |
Re: How do I run a .JAR file from the terminal? [message #1017135 is a reply to message #1016875] |
Sat, 09 March 2013 18:52 |
Hugh Foster Messages: 33 Registered: February 2013 |
Member |
|
|
Russell Bateman wrote on Thu, 07 March 2013 20:19On 3/7/2013 5:46 PM, Hugh Foster wrote:
> lightning@rigel5:~$ java -cp
> temp.jar.lightning.java.hello.MyFirstClass I typed this in and got a
> java command usage index and did not display the file.
Of course, at this point, you're outside this forum and in the realm of
javaranch.com or stackoverflow.com.
Why does Eclipse crash when I select the Javadoc view in the java editor?... For some reason I think all these problems I am having are related to a jre 6 issue... but that is my opinion. I have created a thread at javaranch under a similar name
the execution environment was jre 7 , I have switched it to 6;
the default jre is 7 oracle. that is the only choice in the dialogue.. see screenshot
this is what I think: If I can switch the default to the jre version for this version of juno then it will work, but this is a hunch
[Updated on: Sat, 09 March 2013 19:19] Report message to a moderator
|
|
|
Re: How do I run a .JAR file from the terminal? [message #1017148 is a reply to message #1017135] |
Sat, 09 March 2013 21:45 |
|
On 03/09/2013 11:52 AM, Hugh Foster wrote:
> HI Gang Im back this time with a fun new riddle: Why does Eclipse crash when I select the Javadoc view in the java editor?... For some reason I think all these problems I am having are reltated to a jre 6 issue... but that is my opion. I have created a thread at javaranch under a similar name
>
Still hijacking threads. Forum etiquette frowns upon that and it's not
helpful to those looking later for the same solutions you're asking about.
The image attached does not (for me) illustrate your question about
"select[ing] the Javadoc view in the java editor".
The Javadoc view is separate from the Java editor. Typically, you ensure
that view is visible in another pane (I keep mine in the upper rightmost
pane with Outline, Search, Ant, etc. When you click in a Javadoc blurb,
it displays it.
Or, are you referring to Content Assist which, when you over over
something that's backed by Javadoc, displays information relevant to the
construction in a pop-up?
If you suspect a JRE issue (Java 6 has been very solid for me), ensure
you're using the very latest version which I show to be update 43. From
Sun, that is. I use openjdk on my servers usually (and it works), but on
my development hosts I only use bonafide Sun JVMs.
|
|
|
Re: How do I run a .JAR file from the terminal? [message #1017178 is a reply to message #1017148] |
Sun, 10 March 2013 16:26 |
Hugh Foster Messages: 33 Registered: February 2013 |
Member |
|
|
'Still hijacking threads. Forum etiquette frowns upon that and it's not
helpful to those looking later for the same solutions you're asking about.'
I wrote this thread looking for help. Forgive me if my post was inappropriate however I have been polite thus far. Presumably a bug, or confirmations of one is in the interest of your community.
Regardless, I came looking for anwsers and got them; this I like.
I did infact ask you bateman if this issue warranted a standalone thread, so I creeated this. To get reprimanded on it belies more under the surface of your responses that I care to explore.
My problem with the jar file is now solved : I unearthed a semantics error, now that is resolved however the IDE still crashes when i try to access the help libraries and editorial views.
[Updated on: Sun, 10 March 2013 16:29] Report message to a moderator
|
|
| |
Re: How do I run a .JAR file from the terminal? [message #1017186 is a reply to message #1017179] |
Sun, 10 March 2013 20:14 |
|
On 03/10/2013 10:50 AM, Hugh Foster wrote:
> as for the java crashes, it goes way beyond my expertise to comment on
> why in both Pydev and Java perspectives there is a problem with the
> browser so that it cant render the data.
>
> 'The Javadoc view is separate from the Java editor. Typically, you ensure
> that view is visible in another pane (I keep mine in the upper rightmost
> pane with Outline, Search, Ant, etc. When you click in a Javadoc blurb,
> it displays it.'
>
> right . this pane is on the bottom in plain view. I click on it, and
> same as the library selection in the top right editor... the screens
> greys and crashes
>
> My java is configured and reconfigured and I have read the documentation
> on the java now and know that my system is running the correct java. I
> should also and finally state the error with the javadoc tab and the
> help library could be a Linux Eclipse conflict that has been mentioned
> in some forums and it could be an internal java version issue that
> fortunately have no time to explore.
>
> I was hoping to also grow from this and use this forum as a resource in
> the future for building community links.. after a name change maybe.
> have a nice day all and thanks again for the good references
It wasn't a reprimand, but just an attempt to nudge you to begin a new
thread for each separate issue. If you asked a question that I didn't
respond to, I may not have ready your post attentively enough for which
I apologize.
I haven't done PyDev, so I'm not going to be much help there.
I haven't experienced the crashes you have. My most recent push-back was
an attempt to understand what was giving you trouble exactly.
I'm running Eclipse Indigo, though I have run Galileo, Helios and Juno,
for a very long time on Ubuntu Karmic, Lucid, Maverick and now Precise,
Europa, Galileo and Helios on Windows 7 and openSuSE prior to Ubuntu.
I've experienced none of what I think I understand as your crashes.
If you can muster a stack trace for any of the trouble you experience,
that would be helpful.
I will say that back in the days of Galileo, using Windows 7, I had
troubles crashing while developing for Android until I a) abandoned my
Eclipse Java/JEE for a simple Java one (so, I didn't mix Google ADT in
with Eclipse WTP) and b) ensured I bounced my workbench several times
daily. Since then I don't try to mix types of development on a single
Eclipse installation, but I think it's more superstition on my part than
reality; I've never had any of those troubles on Linux.
Eclipse can sometimes be a pretty steep curve, but that's especially
because it does so much. It also appears weird because fundamentally,
Eclipse is a mass of plug-ins, many developed by sort of "non Eclipse"
people. The support is very heterogeneous too as you're finding out.
I've so far found it worth it, but then I do pretty traditional Java/JEE
development except for some Android once (which, except for the initial
trouble, went very well).
|
|
|
Goto Forum:
Current Time: Fri Apr 26 13:48:17 GMT 2024
Powered by FUDForum. Page generated in 0.06948 seconds
|