can't create new AWS java web project - java

I'm using Eclipse 4.2.1
under OSX 10.8.2.
In Eclipse > Preferences > Java > Installed JREs,
I have Java SE 6 installed.
I installed Amazon AWS SDK from the Eclipse Marketplace.
I'm trying to start a new AWS Java Web Project
and I get the following errors:
Unable to create new AWS Java web project.
One or more constraints have not been satisfied.
Dynamic Web Module 2.5 require Java 1.5 or newer.
but I have Java SE 1.6! Why?
Any ideas?

I installed Eclipse for Java EE instead of Eclipse generic and it solved the issue.

I had a similar problem with Windows 8.1 Pro. I tried a bunch of things, but I wasn't able to successfully deploy anything to AWS ElasticBeanstalk until I removed all existing versions of Java and then installed Java EE 7u45 win32 (previously was JEE 8, both 32 & 64 bit).
But here is what I did entirely:
Deleted existing workspace and created a new one.
Make sure that your AWS Toolkit Preferences are setup correctly: Window -> Preferences -> AWS Toolkit
Removed all existing versions of java.
Downloaded and installed Java EE 7u45 win32.
Made sure that my System Path and JAVA_HOME variables were set properly: Control Panel -> System and Security -> System -> Advanced System Settings -> Advanced -> Environmental Variables
Hope this helps :)

I installed Eclipse 4.3.2, then added AWS on top and I get the same error. Same with running Eclipse on Java 1.7.0_51 or Java 8 (b132).
I also get an error dialog saying "X does not exist" where X is my new project name. X was created but there is only a .project file and one file in .settings.
My error log contains:
Java Model Exception: Java Model Status [X does not exist]
at org.eclipse.jdt.internal.core.JavaElement.newNotPresentException(JavaElement.java:498)
at org.eclipse.jdt.internal.core.JavaModelManager.getPerProjectInfoCheckExistence(JavaModelManager.java:2309)
at org.eclipse.jdt.internal.core.JavaProject.getPerProjectInfo(JavaProject.java:1908)
at org.eclipse.jdt.internal.core.JavaProject.getRawClasspath(JavaProject.java:1930)
at com.amazonaws.eclipse.elasticbeanstalk.webproject.CreateNewAwsJavaWebProjectRunnable.findSdkClasspathEntry(CreateNewAwsJavaWebProjectRunnable.java:219)
at com.amazonaws.eclipse.elasticbeanstalk.webproject.CreateNewAwsJavaWebProjectRunnable.run(CreateNewAwsJavaWebProjectRunnable.java:191)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
org.eclipse.core.commands.ExecutionException: One or more constraints have not been satisfied.
at org.eclipse.wst.common.componentcore.internal.operation.FacetProjectCreationOperation.execute(FacetProjectCreationOperation.java:110)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl$1.run(DataModelPausibleOperationImpl.java:385)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:410)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.runOperation(DataModelPausibleOperationImpl.java:360)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.doExecute(DataModelPausibleOperationImpl.java:247)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.executeImpl(DataModelPausibleOperationImpl.java:219)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.cacheThreadAndContinue(DataModelPausibleOperationImpl.java:89)
at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelPausibleOperationImpl.execute(DataModelPausibleOperationImpl.java:207)
at com.amazonaws.eclipse.elasticbeanstalk.webproject.CreateNewAwsJavaWebProjectRunnable.run(CreateNewAwsJavaWebProjectRunnable.java:150)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: org.eclipse.core.runtime.CoreException: One or more constraints have not been satisfied.
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:363)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1181)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1117)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$1.run(FacetedProject.java:324)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2345)
at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modify(FacetedProject.java:339)
at org.eclipse.wst.common.componentcore.internal.operation.FacetProjectCreationOperation.execute(FacetProjectCreationOperation.java:83)
... 10 more
Dynamic Web Module 2.5 requires Java 1.5 or newer.
Arg,

Related

Java Class cast Exception - Spring boot

Exception in thread "main" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getUrls(DefaultRestartInitializer.java:93)
at org.springframework.boot.devtools.restart.DefaultRestartInitializer.getInitialUrls(DefaultRestartInitializer.java:56)
at org.springframework.boot.devtools.restart.Restarter.<init(Restarter.java:138)
at org.springframework.boot.devtools.restart.Restarter.initialize(Restarter.java:537)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationStartedEvent(RestartApplicationListener.java:68)
at org.springframework.boot.devtools.restart.RestartApplicationListener.onApplicationEvent(RestartApplicationListener.java:45)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:166)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:121)
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:63)
at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:48)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:304)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1186)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1175)
at com.rme.hub.RmeApplication.main(RmeApplication.java:24)
Judging by the presence of java.base/jdk.internal.loader.ClassLoaders in the stack trace, you are using Java 9 or later. Spring Boot's DefaultRestartInitializer is trying to cast the app class loader to a URLClassLoader. This works in Java 8 and earlier but does not work with Java 9 or later. Spring Boot had been updated in 2.0 to cope with this change in Java 9.
If you want to use Spring Boot with Java 9 or later, you should upgrade to Spring Boot 2. At the time of writing, the latest release is 2.0.5 which supports Java 8, 9, and 10. Spring Boot 2.1, which will be released later this year, will add support for Java 11.
I had this problema on eclipse and had solved by doing these step:
First download java 8 (If you don't have) then install it
Second, I am not sure if you have to do it or not but just do it. I create JAVA_HOME path by right click to my desktop -> properties -> Advanced System Setting -> Advanced Tab -> Environment Variables -> Add JAVA_HOME in both User Variables and System Variables -> Click new -> Variable Home is "JAVA_HOME", Variable Value can be left empty -> Browse Directory -> point to your jdk folder (Exmaple: mine is C:\Program Files\Java\jdk1.8.0_291)
Third, go to eclipse -> go to window tab -> choose java on the menu on the left side -> Installed JREs -> in default eclipse already had jre directory -> click to it and then click duplicate -> change the directory to your own jre directory (example: C:\Program Files\Java\jre1.8.0_291)
Forth: back to java menu, choose compiler option -> then on the right side -> change compiler compliance level to 1.8.
That is all!
Hope it will be useful for you.
solution: change JDK version 8 in your IDE
I got the same issue in the spring boot application in IntelliJ idea and sts but I found one solution in that issue :
if you are using AD integration in your project with it belongs to Microsoft, then you need to use java 8 version JDK because currently Microsoft AD plugins are not supported to java 9 or higher version it will support only the java 8 or lower version
Check your JAVA_HOME in hadoop-env.sh. Changing my JAVA_HOME value in $HADOOP_HOME/etc/hadoop with java 8 (export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64) value in the hadoop-env.sh solved this issue for me.
I had a higher java version defined in my hadoop-env.sh value when I had defined java 8 in my .bashrc file. So keeping both the same java 8 version fixed the issue for me.

Deploy Java application with Netbeans to remote OrangePi

I followed the tutorial on youtube how to deploy a Java app to remote RaspberryPi and tryed the same with the OrangePi. The problem I have is that I can't select the remote JVM from the Netbeans..
Here are some screen shoots:
When I try to select a Runtime platform I have only the default JDK1.8 which is installed on the local machine (Project Platform) and the Remote platform (OrangePI) is missing (I can't select it from the list).
I followed this video: https://www.youtube.com/watch?v=EXy5Ysp3yp4&t=301s
The only difference is that I'am using root as user...
regards
Ferguson
The problem was that on OrangePi was Java 1.7 and in Netbeans 1.8...

Glassfish on Eclipse on Mac

I am using Eclipse Luna on Mac Maverick.
I have downloaded GlassFish and extract it.
I have downloaded the Glassfish toolkit from the marketplace.
I am using Eclipse EE.
JAVA_HOME is set to /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/bin
When I try to define a new server, why isn't glassfish showing up as an option? What have I missed?
The problem is actually Eclipse. JDK 7 only works with Eclipse EE in 64 bits version. So, basically if want to make glassfish an available server: you need to:
Use Eclipse EE 64 bits version
Use JDK-7
Make sure your JAVA_HOME is set/updated
(In Mac, it usually sits under /Library/Java/JavaVirtualMachines/)
In Eclipse marketplace, download and install Glassfish-toolkit
(and restart the IDE of course)
Make sure your Eclipse EE/Project is using the correct JDK
(Preference -> Java -> Installed JREs)

What does "Failed to initialize App Engine SDK at [path]" mean, and how to fix it?

I'm using the the "Google Plugin for Eclipse", and installed both the "Web Toolkit SDK" and the "App Engine Java SDK" with it. Weirdly, the App Engine SDK can't be initialized while the Web Toolkit SDK works fine. Trying to point Eclipse to the root GAE SDK directory will cause the "Failed to initialize App Engine SDK at [path]" error. Downloading the GAE SDK separately will yield the same result.
I'm guessing the error is caused by a version problem?
Here is the setup:
Eclipse 3.7 Indigo
Google Plugin for Eclipse 3.7
appengine-java-sdk-1.6.4 , appengine-java-sdk-1.6.5 (manual download)
Java JVM 1.6
Mac OSX 10.5, 32bit
Thanks!
Check the version of Java that you are using.
For instance, if you have a default version of Java on your system that is older than the latest, regardless of what Eclipse is using as it's runtime or project JDK, the SDK may try and initialize with the default JDK on your OS.
For me, the issue was that my default JDK was Java 6, and GAE is not compiled to support anything lower than Java 7 at this point in time.
As suggested above check the versions of installed java sdks and java Jre. I faced the same error.
I have jdk1.7.0_45.jdk and and matching JRE i.e. jre-7u45, then set their path in eclipse->preference->java

How to make Eclipse compile with Java 1.5 in Mac OS X Leopard (10.5)?

I have been developing in Snow Leopard (10.6). I believe I have some Java6-only API features and I'd like to find these. I moved my project to Leopard (10.5) -- since Snow Leopard does not support Java 1.5 -- but I am so far unable to make Eclipse give compile errors for a Java API call which I know to have been added in 1.6.
Here is what I have done: Project properties -> Java Compiler -> set everything to 1.5. Preferences -> Java -> Installed JREs -> selected JVM 1.5.0. Project properties -> Java Build Path -> Libraries -> says JRE System Library [JVM 1.5.0]
What am I missing? Is there another way to find Java API calls added in 1.6 when using Eclipse in Snow Leopard?
Thanks.
If JVM 1.5.0 is set as your system library and the compiler settings are at 1.5 then the only other possible problem would be other libraries (non-JVM) that may have 1.6 code and that should just be a matter of checking the library providers documentation as to minimum requirements. The only other check would be if you have unit tests run them in the 1.5 JRE you have installed, or lacking that launch your app using a 1.5 JVM and run it through its paces.

Categories

Resources