Eclipse/Java class couldnt be found - java

I am new to Java and have some basic problem. Would appreciate your help guys.
I try to run a HelloWorld program but having an error:
"Error: Could not find or load main class HelloWorld".
I noticed that Eclipse saves the project in parallel virtual store directory and not the one I mentioned.
When I manually move the project to Eclipse_Workspace directory it works just fine. What should I do for Eclipse to save the files correctly?!
If needed:
I downloaded JDK 1.8.0_51 for Win 32 and Eclipse IDE for Java developers (Luna Service Release 1 (4.4.1)). Win7 32 Ultimate.
I added a Path value in System Variables -
C:\Program Files\Java\jdk1.8.0_51\bin
Default Resource Path in Eclipse is:
C:\Program Files\Java\Eclipse_Workspace
Thanks

VladBio,
Make sure the following environment variables set correctly:
JAVA_HOME = jdk root folder (C:\Program Files\Java\jdk1.8.0_51)
Path = jdk bin folder (C:\Program Files\Java\jdk1.8.0_51\bin)
To test this go into your cmd (Start -> run -> cmd) and type:
java -version
C:>java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
If you see the correct version then the issue is in Eclipse.
In Eclipse you can check your JDK settings in Windows -> Preferences -> Installed JREs. Your correct JDK should be listed there.
On Eclipse you can also have project specific java version.
Right click on your project -> properties. On Library tab you should see something like JRE System Library [jdk1.8.0_45]
Check here for a more detailed answer of what could be going wrong.
I Hope this helps.

Thanks a lot.
I suppose I figured this out.
It was a problem in eclipse - it couldnt automatically make a changes in java directory because any change there is allowed only with admin approval.
I changed the path in eclipse to a folder on my desktop. It solved out the problem.
BTW I tried what you said and the output in cmd was identical to yours.
Thanks again

Related

Intellij 2019.2: GlassFish requires Java SE version 6. Your JDK is version 0

I'm working with IntelliJ 2019.2 and cannot start the Glassfish Server 4.1.2 (Full Platform). I've found some solution proposals for this error, but none of them worked for me, e.g. this post or this article.
Output
C:\workspace\resources\server\glassfish4\glassfish\bin\asadmin.bat start-domain domain1
GlassFish requires Java SE version 6. Your JDK is version 0
"C:\Program Files\Java\jdk1.8.0_221\bin\java.exe" -Dfile.encoding=windows-1252 -classpath "C:\workspace\resources\server\glassfish4\glassfish\modules\javax.ejb-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.servlet-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.servlet.jsp-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules;C:\workspace\resources\server\glassfish4\glassfish\modules\acc-config.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\admin-cli.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\admin-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\admin-util.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\amx-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\amx-javaee.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\annotation-framework.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ant.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\antlr-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\aopalliance-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\api-exporter.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\appclient-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\appclient-server-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\appclient.security.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\asm-all-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\asm-all.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\org.apache.felix.configadmin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\org.apache.felix.eventadmin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\org.apache.felix.fileinstall.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\org.apache.felix.gogo.command.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\org.apache.felix.gogo.runtime.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\org.apache.felix.gogo.shell.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\org.apache.felix.scr.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-cdi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-ee-resources.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-ejb-container.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-http.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-javaee-base.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-jdbc.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-jpa.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-jta.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\autostart\osgi-web-container.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\backup.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\bean-validator-cdi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\bean-validator.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cdi-api-fragment.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cdi-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\class-model.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cluster-admin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cluster-common.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cluster-ssh.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cmp-ejb-mapping.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cmp-enhancer.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cmp-generator-database.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cmp-internal-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cmp-model.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cmp-support-ejb.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cmp-support-sqlstore.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\cmp-utility.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\com.ibm.jbatch.container.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\com.ibm.jbatch.spi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\common-util.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\concurrent-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\concurrent-impl.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\config-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\config-types.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\connectors-admin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\connectors-inbound-runtime.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\connectors-internal-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\connectors-runtime.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-cluster-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-common-full-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-common.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-community-branding-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-concurrent-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-corba-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-ejb-lite-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-ejb-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-jca-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-jdbc-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-jms-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-jts-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-plugin-service.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-updatecenter-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\console-web-plugin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\container-common.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\dataprovider.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\dbschema-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\deployment-admin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\deployment-autodeploy.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\deployment-client.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\deployment-common.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\deployment-javaee-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\deployment-javaee-full.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\dol.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ejb-client.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ejb-container.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ejb-full-container.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ejb-internal-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ejb.security.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\endorsed\javax.annotation-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\endorsed\jaxb-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\endorsed\webservices-api-osgi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\entitybean-container.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\flashlight-extra-jdk-packages.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\flashlight-framework.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-admingui-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-client-module.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-connectors-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-ejb-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-jms-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-jms-injection.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-jpa-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-load-balancer-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-restadmin-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-web-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gf-weld-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-batch-commands.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-batch-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-corba-csiv2-idl.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-corba-internal-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-corba-omgapi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-corba-orb.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-ee-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-extra-jre-packages.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-grizzly-extra-all.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-mbeanserver.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-naming.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-oracle-jdbc-driver-packages.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish-registration.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\glassfish.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gmbal.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gms-adapter.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\gms-bootstrap.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\guava.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ha-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ha-file-store.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ha-shoal-cache-bootstrap.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ha-shoal-cache-store.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\hk2-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\hk2-config.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\hk2-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\hk2-locator.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\hk2-runlevel.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\hk2-utils.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\hk2.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\inmemory.jacc.provider.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\internal-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\j-interop-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jackson-annotations.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jackson-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jackson-databind.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jackson-jaxrs-base.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jackson-jaxrs-json-provider.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jaspic.provider.framework.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javaee-kernel.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javamail-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javamail-runtime.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javassist.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.batch-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.el.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.enterprise.concurrent-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.enterprise.concurrent.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.enterprise.deploy-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.faces.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.inject.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.interceptor-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.jms-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.json.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.mail.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.management.j2ee-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.persistence.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.resource-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.security.auth.message-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.security.jacc-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.servlet.jsp.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.servlet.jsp.jstl-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.servlet.jsp.jstl.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.transaction-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.websocket-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.ws.rs-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.xml.registry-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\javax.xml.rpc-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jaxb-extra-osgi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jaxb-osgi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jboss-logging.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jdbc-admin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jdbc-config.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jdbc-runtime.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-bean-validation.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-cdi1x-servlet.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-cdi1x-transaction.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-cdi1x.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-client.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-common.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-container-grizzly2-http.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-container-servlet-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-container-servlet.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-entity-filtering.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-gf-ejb.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-guava.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-media-jaxb.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-media-json-jackson.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-media-json-jettison.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-media-json-processing.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-media-moxy.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-media-multipart.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-media-sse.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-mvc-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-mvc-jsp.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-mvc.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jersey-server.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jettison.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jms-admin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jms-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jmxremote_optional-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jpa-container.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jsf-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jsftemplating.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jsonp-jaxrs.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jspcaching-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jsr109-impl.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jstl-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jta.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\jts.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\kernel.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\launcher.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ldapbp-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\libpam4j-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\load-balancer-admin.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\logging.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\management-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\metro-glue.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\mimepull.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\monitoring-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\nucleus-grizzly-all.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\nucleus-resources.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\orb-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\orb-enabler.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\orb-iiop.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.apache.felix.bundlerepository.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.antlr.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.asm.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.dbws.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.jpa.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.jpa.jpql.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.jpa.modelgen.processor.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.moxy.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\org.eclipse.persistence.oracle.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\osgi-adapter.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\osgi-cli-remote.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\osgi-container.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\osgi-jpa-extension.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\osgi-resource-locator.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\persistence-common.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\pfl-asm.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\pfl-basic-tools.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\pfl-basic.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\pfl-dynamic.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\pfl-tf-tools.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\pfl-tf.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\pkg-client.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\registration-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\registration-impl.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\resources-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\resources-runtime.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\rest-client.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\rest-service.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\scattered-archive-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\schema2beans-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\security-ee.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\security-services.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\security.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\shoal-cache.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\shoal-gms-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\shoal-gms-impl.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\simple-glassfish-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\soap-tcp.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\ssl-impl.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\stats77.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\stax2-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\transaction-internal-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\trilead-ssh2-repackaged.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\tyrus-client.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\tyrus-container-glassfish-cdi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\tyrus-container-glassfish-ejb.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\tyrus-container-grizzly-client.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\tyrus-container-servlet.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\tyrus-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\tyrus-server.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\tyrus-spi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\war-util.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\web-cli.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\web-core.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\web-embed-api.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\web-glue.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\web-gui-plugin-common.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\web-ha.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\web-naming.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\web-sse.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\websecurity.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\webservices-connector.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\webservices-extra-jdk-packages.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\webservices-osgi.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\webservices.security.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\weld-integration-fragment.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\weld-integration.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\weld-osgi-bundle.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\woodstox-core-asl.jar;C:\workspace\resources\server\glassfish4\glassfish\modules\work-management.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2019.2\plugins\JavaEE\lib\javaee-impl.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2019.2\lib\platform-api.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2019.2\lib\util.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2019.2\plugins\Glassfish\lib\specifics\glassfish3.1-specifics.jar" com.intellij.javaee.oss.process.JavaeeProcess 58993 com.intellij.javaee.oss.glassfish.agent.Glassfish31Agent
Detected server admin port: 4848
Detected server http port: 8080
It already worked once, but I had to change my workstation and reinstall IntelliJ
I also updated my JDK, it is still version 8, but now another u number (8u221, I don't know which version I used before)
The Application Server settings in IntelliJ are correct
The Glassfish logs are empty
My JAVA_HOME is set correctly (C:\Program Files\Java\jdk1.8.0_221)
I added %JAVA_HOME%\bin to the PATH variable.
I'm able to start the server over the cmd (asadmin.bat start-domain domain1)
Ensured that correct SDK is set in IntelliJ (Project Structure -> Platform Settings)
Tried different Java Compiler Settings (IntelliJ Settings), e.g. changed Project Byte Code version to 6 instead of 8.
Adding the line AS_JAVA=MY_JDK_DIRECTORY did not help
Reinstalling Glassfish did not help
Glassfish Plugin in IntelliJ is enabled (default)
java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)
I don't know what to do anymore, can someone help me please?
Inside of your Injellij double shift (press shift twice) to open the search and type in JDK. Under actions click on switch boot JDK and make sure you have one there if not select one and then click save and restart. hope this works and helps.
The root case of the issue is logged here.
Windows launcher prepends PATH with JetBrains Runtime bin directory in order to load certain DLLs without issues. It turned out to be not the best solution and we are working to address it in a different way.
asadmin.bat uses the first java.exe from PATH. It doesn't try to detect it via JAVA_HOME. Therefore the workaround for now is to switch IntelliJ IDEA boot JDK to JBR8 per this document or start IntelliJ IDEA using idea.bat instead of idea64.exe.
I tried changing the IntelliJ configuration but no luck.
I tried starting the server from the command line using: "C:\Program Files (x86)\glassfish4\glassfish\bin\asadmin.bat" start-domain --debug domain1.
I still got the error from the command line.
I had to edit the following file:
PATH_TO_YOUR_GLASSFISH/glassfish/config/asenv.bat
Literally: C:\Program Files (x86)\glassfish4\glassfish\config\asenv.bat
I added the following to the end: set AS_JAVA=PATH_TO_YOUR_JDK
Literally: set AS_JAVA=../../../../Program Files/Java/jdk1.8.0_261
I finally tracked the answer down from this question:
How do I specify the JDK for a GlassFish domain?
I have the same problem on linux host installed with Java 10.
Settings JAVA_HOME, AS_JAVA or updating asenv.conf does not solve the problem. Event checking current active JDK .
It seems that Glassfish supports JDK6 only. It does not work with JDK10 or JDK8.
I tried every suggestion her but it did not work. For me problem was that my Glassfish configration was not pointing to correct directory. It was pointing to C:\payara5\glassfish. I changes it to C:\payara5 and it worked.

Can't find Java JDK in IntelliJ, running Fedora 24

I can't find the directory in which to set up Java as my project JDK in IntelliJ. I tried pointing it to /usr/java/java[version-number] but IntelliJ said that it was an invalid directory. (I don't remember exactly what the folder was called, I just remember it was Java 8.)
I did some googling and found out that it may be because it was corrupted, and they recommended wiping it and doing a reinstall... so I deleted the java[version-number] folder in /usr/java and attempted to do a reinstall by downloading the jdk rpm file from Oracle's website, but apparently I still have the 1.8.0 JDK installed?
When I type in java -version into terminal, I get the following:
openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)
I'm not sure where to go from here.
For me the problem was different. I installed IntelliJ's flatpack version of the IDE.
flatpack has restrictions to use the file system.
These directories are blacklisted:
/lib, /lib32, /lib64, /bin, /sbin, /usr, /boot, /root, /tmp, /etc, /app, /run, /proc, /sys, /dev, /var
Exceptions from the blacklist: /run/media
These directories are mounted under /var/run/host: /etc, /usr
So you have to use path something like /var/run/host/usr/lib/jvm/java-1.8.0-openjdk-amd64.
I actually downloaded the IntelliJ Toolbox and installed it from there.
try whereis java maybe it'll show up in your terminal

Android Studio Setup - could not detect JDK

I'm trying to install the Android Studio on my Windows 7 notebook, but even when I filled the path with the JDK, occurs the following error:
I already set the environment variables JAVA_HOME, PATH, reboot the notebook, but still have problem. I'm using the "android-studio-bundle-141.2456560-windows" version and also the "jdk-7u79-windows-x64".
Could you please, help with this issue?
Have you tried to run java.exe -version in a terminal, if the jdk is installed it should return something like:
java version "1.8.0_72"
Java(TM) SE Runtime Environment (build 1.8.0_72-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.72-b15, mixed mode)
if not, you might want to reinstall it and reset the path.
What you might also want to do, is go to the jdk location and make sure it contains a directory named bin and see if it has the java.exe file in it.
In this link Android Studio ZIP, I did the download for windows after unzip all the file, I started execute the "studio.exe", that is inside the bin folder.
Thanks everyone for the help.
I downloaded Android Studio for windows, then I unzipped all the file. I started executing the "studio.exe", that is inside the bin folder. It worked.
Thanks everyone for the help.
#Victor W. Vieira this works fine for me. On Windows Professional x64-bit system.

Java -version will not update after SDK installation

I am having an issue launching Eclipse saying incorrect JVM version(1.5, needs 1.7+), I installed both Java 7 and 8 from the website but when checking the version in cmd, i am still seeing 1.5
java version "1.5.0_30"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03)
Java HotSpot(TM) Client VM (build 1.5.0_30-b03, mixed mode)
It was my understanding that when I install a newer jdk, this version would update. How can I manually update this?
My Java_Home variable is pointing to the newer jdk.
C:\Program Files (x86)\java\jdk1.7.0_79
check your PATH environment variable
Start eclipse with the -vm argument, followed by the address of the jvm you want to use.
This way, you'll be sure of the version you're using.
Example:
eclipse.exe -vm C:\_jde\Java\jdk1.8.0_45\bin\javaw.exe
I think you need to add your JAVA_HOME variable to path as well.
appending the JAVA_HOME like this should set java 7 to default in your system .
%JAVA_HOME%\bin;
or you can check this link to see how to set java.
It's most likely that your system variable is still having this. Please recheck your system variable.
Also, you have an option of setting your default JRE:
Open Eclipse.
Navigate to Window > Preferences > Java > Installed JREs
Set your default JRE
I face this issue whenever i switch between various Java versions. The solution is below:
Go to c:\Windows\system32
Delete java.exe, javaw.exe, javaws.exe files
Open the command prompt and check the java -version.
Hope this is helpful!

Android - Eclipse JRE not found

I have downloaded Android ADT Bundle and trying to create hello world android app.
I am following Setting up ADT Bundle which says just extract the zip file and launch the Eclipse.
I am getting following error
"A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: C:\adt\adt-bundle-windows-x86_64-20131030\eclipse\jre\bin\javaw.exe ..."
I know I can install JRE (with or without JDK), and set up javaw.exe dir in path ENV and the problem will go away.
But I think i ADT bundle should be self sufficient and should not require any additional download. Peculiar thing is that I cannot find jre dir inside eclipse.
Am I missing some additional steps? if yes, what steps?
Not sure this the best way to do but if copy paste the JRE folder inside the ecplise folder it works.
But I think i ADT bundle should be self sufficient and should not require any additional download. Peculiar thing is that I cannot find jre dir inside eclipse.
I don't think so eclipse folder will be having JRE folder you have to specify the path JDK path in ENV.
Check Windows -> Preferences -> Compiler and Windows -> Preferences -> Installed JREs.
If not configure them. If you have not installed JDK(It has JRE in it) then install it first.
To verify type java -version in your command line.
You should get output like
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
(Java 7 is latest but you can use any version that suits your requirement)
You should Install JDK and set class path. Because for compilation you need JDK not just JRE and JDK internally contain JRE.Therefore no need of installing JRE separately.

Categories

Resources