does sysdeo tomcat plugin for eclipse add value to helios? - java

am developing a simple web app using jsps and servlets for tomcat 5.5.
Currently using the Eclipse Helios and Dynamic Web Application Project.
For some reason it is a nightmare. We spent 4 hours today trying to deploy a servlet to tomcat. We kept getting errors like
"java.lang.UnsupportedClassVersionError: Bad version number in .class file"
we played around with everything trying to set the build compatibility to what tomcat had but couldn't make the stupid thing work. (Yes it is possible we're incompetent. any suggestions on what we can try looking at are apprecieated)
My friend recalls from long time ago that he used this plugin
eclipsetotale_tomcatPlugin
in order to create a "tomcat project". My question is, does sysdeo tomcat plugin add any features that aren't already available in helios?
thanks

Not sure about sysdeo, but your error seems similar to bug 116713:
If your default JRE is set to 1.4.2 and you have a Web project targetting
Tomcat 5.5 (dynamic Web module version 2.4 and Java 5.0), when you tried to run
a main program, you'll get the error (you mention).
What is your default JRE set for your project?

This scenario happens when the JVM running the code is older than the one the compiler generated code for.
Have you considered simply running Tomcat under Java 6? If that is not an option, please edit your question to include this and any other restrictions on this project.

We used to get that error often when we had Java version issues. Eclipse environment and Windows environment (java_home and path variables typically) are easy to overlook.
Also, you can use javap -v Foo in same directory as Foo.class to find out its version.

Just use the Eclipse IDE for Java EE Developers, 206 MB edition of Eclipse. It has Tomcat and other webserver support built-in by default. Works like a charm!
Sysdeo is an old, as far as I know obsolete, plugin.

Related

Java Class files in tomcat not linking/updating when using eclipse

I am working on an old jsp project. I have to modify it so that I can use it to meet my needs. I was facing issue while using any newer version of tomcat or java sdk. Therefore, I am using Tomcat 5.5.7 and java SDK 1.5. I have updated java class files of this project using eclipse helios (2012). But the implementation don't show up in my project. Like when I change the database name and run the project it still wants to use the old database name. I have tried to upgrade the whole project to a new version of tomcat and java sdk but it doesn't work. Can anyone help me with this?
Steps you need to take -
Import the project into eclipse - Create a new project, import using existing source files.
You need to setup the Java Facet of "Dynamic Web Application" along with some other Facets to make this application run successfully on the tomcat container inside of eclipse.
You need to install the server tools in eclipse. Using the Java EE perspective is very helpful.
When making changes to the JDK or the server runtime, as you mentioned, you will need to update the projects build path. Right click on the root of your project and go to the build path. Change the SDK version, change the runtime version of tomcat that is included with it. You will need to create a new Java Server runtime for any other versions of Tomcat you want to add to the project.
This is a complicated issue, and there is no specific answer, as your question is very broad. I would recommend watching some tutorials on "How to setup Web application projects in Eclipse." Maybe add Java 5 or 6 to the search to get older results.

Apache netbeans IDE 10.0 installed with JEE Support but annotations still as error

I have installed Apache Netbeans IDE 10.0 on Linux Mint, and followed this recommendation to activate JEE support ( https://superuser.com/questions/1404517/how-to-enable-java-ee-in-apache-netbeans-ide-10 ). I have restarted Netbeans and JEE annotations are marked as errors "Incompatible types : Path cannot be converted to annotation". This happens with all Java EE annotations, and I don't know how to solve this.
I have tried to do clean and build but still the same. Here is a screen shot of some sample errors:
You are having problems because the solution you followed for the accepted answer to the superuser question How to Enable Java EE in Apache Netbeans IDE 10 is wrong.
That answer advises you to use an Update Center to download some plugins used in NetBeans 8.2. That was an appropriate workaround on NetBeans 9, but wrong for NetBeans 10 since the appropriate plugins you need are already available (on the Tools > Plugins > Available Plugins tab), and you just need to install them. You don't need to obtain any plugins from any Update Center for Java EE, and doing so will probably be harmful.
See this SO answer to the SO question How to create Web Application in Apache Netbeans 10? for details on which of the available plugins need to be installed.
Notes:
I think you should first reinstall NetBeans 10 if possible, to start with a clean environment.
If that is not possible you should first uninstall those NetBeans 8.2 plugins you added to NetBeans 10, and then restart NetBeans.
Although the SO answer I linked to is for a slightly different question, the solution applies equally to your problem.
Although not related to your question at all, you might consider also upgrading to Apache NetBeans to version 11.1 if that is possible. If you did that you would still follow exactly the same process detailed in the linked answer for installing the Java EE plugins.

Does JSP in Google AppEngine support JDK1.8

I have an app engine project in Eclipse. I have kept a JSP file in WAR folder. I have given the path in the installed jre as JDK1.8. Now when I run the project in local the JSP file successfully loads after clicking on a hyperlink. The same project after deployed to Google App Engine fails to load. It shows server error.
What I thought as the possible cause: I read some where that Google AppEngine now supports JAVA 7. So when I compile the JSP file in JDK1.8 in local it worked fine. But the problem occurred when I deployed the project in cloud. I think, it could not compile JSP files.
Please suggest me what you think ? Is it because of same cause ?
As per the documentation available, "App Engine runs your Java web application using a Java 7 JVM in a safe "sandboxed" environment.". So that is as far as the runtime is concerned. It does have a backward compatibility for Java 6 applications for now.
However, keep in mind that the App Engine SDK now supports only Java 7. And ideally I would not go with JDK 8, where things are still in the works.
Behind the scenes, when you upload your application to App Engine, they know which Java runtime to use based on the SDK JAR that you have linked. So ideally, that is taken care of for you.
So, I still believe that though you have provided JDK 1.8 locally, the App Engine version JAR will be enough for Google to deploy your application in an appropriate Java 7 JVM and things should have worked if it is just a simple JSP that you are trying to link up.
Since you have not given details on what the JSP does, it would be good to know that since that could give some pointers. Additionally, I suggest that you allow for DEBUG logs and visit the Admin Console logs to understand what is going wrong. That will give you more details.
I had exactly this problem; including even one JSP file, even with no Java code or any content at all, would prevent my appengine instance from starting.
The solution was to make sure you start Eclipse using the 1.7 VM, even if you're developing against the 1.8 JDK. Because my Eclipse instance was running in the 1.8 VM, the generated JSP files were incompatible with AppEngine.
You change the host VM in the eclipse.ini as shown here: Google App Engine JSP can't deploy: java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE

Set up Tomcat server on a Mac

I need to get a local setup of Java working so I can start coding locally and doing builds.
I know that Java is built into macs automatically. I am running version 1.6.0_22
I found an article on how to install tomcat:
Tomcat on a Mac
I got the Tomcat server running to where i can see the default Tomcat Page.
Started to dig deeper but hit a huge wall on getting to a point where i could use an IDE to get coding.
I downloaded Eclipse for the mac (because it was free and seemed to be the more popular one out there)
So where do i need to go from here to get a working environment to test code from our svn?
Any good articles that i can read. It was hard to find some (recent) documentation on how to get this working on a mac.
Which version of Eclipse did you download? I'm guessing you downloaded Eclipse IDE for Java Developers, which doesn't have the nice WTP stuff that you probably want.
You'll need a heavier flavor of Eclipse, like Eclipse IDE for Java EE Developers. I'm not sure if there's a lighter (in-between) flavor that has WTP, etc., without all the Java EE stuff.
Assuming you have some sort of SVN client and know how to create a trunk on your local machine, do that, and then all you have to do from there is open the java project in that trunk within Eclipse. Once you have that open, on the Eclipse toolbar just build your code, make sure that works, and then run it in the same fashion.

Having hard time to publish files to Tomcat from Eclipse

Sorry if my question seems dumb. I've started using Eclipse Ganymede 3.4 this week and having hard time publishing my projects to the web app server.
First of all you need to know this issue:
i installed my Tomcat 6.0.18 from Netbeans that i use for PHP and J2SE project. While i can start that server from either Netbeans or Eclipse, it can not start manually for some reason even though i setup my JAVA_HOME correctly pointing to jdk/bin it's saying it's a jre. it a bit weird but i can use the IDE to get going. i did some research on the net and find out that eclipse doesn't publish to tomcat.
In fact i always develop by having a local copy on other drive than C where XP is installed and publish to a server installed on C.
So where i need to find a way to publish to Tomcat under C.
It there any simple way to do that?
Please share your experience.
Thanks for reading
Ps : i know that i can use Netbeans but i'ld like to use Eclipse and use its wysiwyg
thanks!
WTP (Web Tools Platform) should get you what you need. It's a set of Eclipse plugins which includes a one to start/stop/debug Tomcat and publish to a local Tomcat installation.
http://www.eclipse.org/webtools/
You can download a version of Eclipse that already includes WTP: Eclipse IDE for Java EE Developers.
I admit this is not the best practice for a general case, but in my local development environment I created a separate Tomcat environment and I simply store the project itself in this Tomcat's webapps directory. This way the 'deployment' is implicit and instant.
Of course when I need to do changes in the code which cannot be incrementally added during a debug session, I have to restart the Tomcat.

Categories