Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export runnable JAR files from within eclipse [SPR-17544] #22076

Closed
spring-projects-issues opened this issue Nov 28, 2018 · 6 comments
Closed

export runnable JAR files from within eclipse [SPR-17544] #22076

spring-projects-issues opened this issue Nov 28, 2018 · 6 comments
Labels
status: invalid

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Nov 28, 2018

huangliusong opened SPR-17544 and commented

Spring-based project to export into a jar to do then, the second option of eclipse is used to derive the executable jar, couldn't find the namespace, normal, in the eclipse runtime is derived when won't run, https://gitee.com/huangliusong/demo2 this is the source code, hope you glad


No further details from SPR-17544

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 28, 2018

huangliusong commented

Spring-based project to export into a jar to do then, the second option of eclipse is used to derive the executable jar, couldn't find the namespace, normal, in the eclipse runtime is derived when won't run, https://gitee.com/huangliusong/demo2 this is the source code, hope you glad

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 28, 2018

huangliusong commented

These are exception messages when it run

 

huangliusng:Desktop liusonghuang$ java -jar aaa.jar 

Error: A JNI error has occurred, please check your installation and try again

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext

at java.lang.Class.getDeclaredMethods0(Native Method)

at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)

at java.lang.Class.privateGetMethodRecursive(Class.java:3048)

at java.lang.Class.getMethod0(Class.java:3018)

at java.lang.Class.getMethod(Class.java:1784)

at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)

at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)

Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext

at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

... 7 more

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 28, 2018

Zhang Jie commented

If you want to run spring-based project with command "java -jar aaa.jar", you must specify the dependencies jar using -classpath, or you can package a "fat" jar whitch contains all dependencies in one single jar. I see that you are using maven, you can try Maven Assembly Plugin and package jar using maven instead of eclipse.Or you can simply use spring-boot.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 28, 2018

huangliusong commented

Thank you for your reply,Because of technical requirements that we cannot build projects using maven, we cannot use maven's packaged plug-ins.we can't use springboot to build projects either.How can I package a ''fat'' jar?

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 28, 2018

Stéphane Nicoll commented

This looks like more a question than a bug report and we don't use the issue tracker for that. Please use StackOverflow.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Nov 28, 2018

huangliusong commented

ok ,you are right

@spring-projects-issues spring-projects-issues added type: bug status: invalid and removed type: bug labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid
Projects
None yet
Development

No branches or pull requests

1 participant