SRL Archive - Java Help and Tutorials

Eclipse is being retarded.


rj

2014-02-27 22:46:55

I can't export my jar.

Here is a list of projects it lets me export…



And here is a list of projects I actually have in eclipse..




So why can I not actually export the jars that I need to.. ?

core

2014-02-28 00:01:42

Those aren't projects in the first screenshot, those are launch configurations. If you want just a jar, export as a jar and it won't ask you for a launch configuration. If you want a runnable jar (aka main method in the manifest), you need to create a run configuration first, usually the easiest way is to run your project in eclipse, then it should populate the launch config in the list.

rj

2014-02-28 06:57:28

From: core
Those aren't projects in the first screenshot, those are launch configurations. If you want just a jar, export as a jar and it won't ask you for a launch configuration. If you want a runnable jar (aka main method in the manifest), you need to create a run configuration first, usually the easiest way is to run your project in eclipse, then it should populate the launch config in the list.


I did run it in eclipse :s many time

Brandon

2014-02-28 12:28:15

From: Officer Barbrady
I did run it in eclipse :s many time


Right click the project and press export. Choose Java->Jar. Choose export resources and source files.
Choose Finish.

Should now have a run-able jar file and be shot for using eclipse.

It is harder to help with IDE trouble than it is to help with coding trouble.

NKN

2014-02-28 14:24:55

From: Brandon
Right click the project and press export. Choose Java->Jar. Choose export resources and source files.
Choose Finish.

Should now have a run-able jar file and be shot for using eclipse.

It is harder to help with IDE trouble than it is to help with coding trouble.


IntelliJ for life? :bart:

rj

2014-02-28 19:13:37

From: Brandon
Right click the project and press export. Choose Java->Jar. Choose export resources and source files.
Choose Finish.

Should now have a run-able jar file and be shot for using eclipse.

It is harder to help with IDE trouble than it is to help with coding trouble.


I do that but when I double click the .jar nothing pops up -.-.-.-.-.-.-.-


Installing netbeans ATM

core

2014-02-28 19:32:27

From: Officer Barbrady
I do that but when I double click the .jar nothing pops up


Because choosing Export > Java > JAR File does not create a runnable jar.

Export > Java > Runnable JAR File creates a runnable jar.

The problem is not with the IDE.

rj

2014-02-28 19:37:06

From: core
Because choosing Export > Java > JAR File does not create a runnable jar.

Export > Java > Runnable JAR File creates a runnable jar.

The problem is not with the IDE.


When I choose runnable it doesn't have my launch configuration

Brandon

2014-02-28 20:36:22

It does create a run-able jar :l He is trying to double click the jar and that's why it isn't running?


From: Officer Barbrady
I do that but when I double click the .jar nothing pops up -.-.-.-.-.-.-.-



Because the jar might not have a proper manifest OR you might not have your registry set right..

C:\Program Files\Java\jre7\bin\javaw.exe" -jar "%1" %* is what it needs to be opened with through double clicking.. That requires these two Default keys to be modified: HKEY_CLASSES_ROOT\jarfile\shell\open\command and HKEY_LOCAL_MACHINE\SOFTWARE\Classes\jarfile\shell\open\command


However, if you don't care about double clicking then try pressing "WindowsKey + R" and then type "cmd".
In cmd, type "java -jar MyJarFile.jar"

where MyJarFile is the location of your jar.. if it runs fine, there is no problem with the IDE being retarded or your Jar file.. It's your system.

core

2014-02-28 20:45:33

From: Brandon
It does create a run-able jar :l


Yes, this is technically true.

But in order to be able to run the jar, make sure you don't click "Finish" until you click "Next" all the way through to the JAR manifest specification and specify your main class.

The Runnable Jar option just hides away much of the configuration in favor of making the process simpler.