How to use Esapi 1.4.4 package in web application - java

I am currently working on a project that uses JDK 1.4. So its just turned out to be that we have to use ESAPI 1.4.4 which is the only version compatible with JDK 1.4 . I downloaded it from the following path https://github.com/esapi/esapi-java-legacy but it doesnt seem to be a jar file . I couldnt figure out how to include this in my eclipse project or how to bring it into my classpath. Is it possible to get the JAR ??? Someone please guide me how to use it or any sample project for reference is sufficient .Thanks in advance

Ditching JDK 1.4 is my top recommendation as well. But if that is not an option for some reason, then I would try pulling down the ESAPI code base from GitHub (https://github.com/ESAPI/esapi-java-legacy), changing the tag under the maven-compiler-plugin plugin from 1.7 to 1.4 and see if it compiles. Much of it probably will be fine, but you likely will have some huge 3rd party FOSS dependency issues so you will have to adjust those. So, before you go down that route, figure out what exactly it is that you need. If you only need ESAPI's output encoding, use the OWASP Java Encoder Project instead. Various other substitutes are described here: https://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Should_I_use_ESAPI_3F
Good luck.
-kevin

Related

Unable to install org.eclipse.ajdt.ui.nature in Spring Tools 4 / Eclipse

I just downloaded the latest Spring Tools 4 package, 4.3.2 RELEASE. My code base makes widespread use of AspectJ, and every time I try to import a project, I get a "Marketplace solutions available" dialog saying my IDE is missing natures to properly support my projects. It offers org.eclipse.ajdt.ui.ajnature as a solution, but the marketplace won't install it. When I try to access it directly through the Eclipse marketplace in my browser, I get an error dialog saying it's not compatible with this version of Eclipse. I'm using Java 11 on Linux. It's a little hard to figure out which version of Eclipse is embedded in this tool, but it appears to be Eclipse Equinox. Thanks for any help or suggestions.
The link provided by howlger http://download.eclipse.org/tools/ajdt/48/dev/update was the missing piece of information. That solves the problem, everything builds.

Why is IntelliJ IDEA unable to determine java version?

I'm rather new to IntelliJ IDEA and Grails in general. I just started a new Project, selected my project JDK (11.0.1) and Gradle distribution (4.10.2). Whenever I try to run the project, I get this error:
Error initializing classpath: Could not determine java version from
'11.0.1'. java.lang.IllegalArgumentException: Could not determine java
version from '11.0.1'. at
org.gradle.api.JavaVersion.toVersion(JavaVersion.java:68) at
org.gradle.api.JavaVersion.current(JavaVersion.java:78) at
org.gradle.internal.jvm.UnsupportedJavaRuntimeException.assertUsingVersion(UnsupportedJavaRuntimeException.java:29)
at
org.gradle.tooling.internal.consumer.ConnectorServices.checkJavaVersion(ConnectorServices.java:66)
at
org.gradle.tooling.internal.consumer.ConnectorServices.close(ConnectorServices.java:53)
at
org.gradle.tooling.internal.consumer.DefaultGradleConnector.close(DefaultGradleConnector.java:57)
at
org.grails.cli.gradle.cache.CachedGradleOperation.call(CachedGradleOperation.groovy:78)
at
org.grails.cli.GrailsCli.populateContextLoader(GrailsCli.groovy:525)
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:508)
at
org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:306)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:269) at
org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
All other discussions of the problem I found suggested changing the Gradle distribution, which I already did. I would be so happy if anybody could help me out here.
Cheers!
May be your java configuration is not correct. If not correct follow this steps.
Goto File-> Project Structure.
Change SDK
Or gradle version is not matching jdk 11 then skip this answer.
Besides the issue with Gradle above, if you're trying to run a Grails project I don't think you can do that with JDK higher than version 8.
Even the latest Grails (3.3.8 as of this writing) is still based on SpringBoot 1.5 which does not support newer JDK, I don't know if there's a special trick to make it work.
I had to delete the .gradle directory and restart Intellij.

How do I install an external maven plugin into my Codenvy maven project?

I'd like to add the plugin here to my existing Maven project in Codenvy. The aim is to be able to use lambda notation in Java 7, as Codenvy doesn't yet have support for Java 8. I've looked around and I don't know if it is just my incompetence, but I can't seem to find a way of doing it. Unless I'm missing something or just don't understand it fully, it seems it isn't possible.
Any help is much appreciated. Thank you
It is possible to use Java 8 in Codenvy (however there's no code assistant support)
You may use a custom runner with codenvy/jdk8_maven3_tomcat8 image (inherit from it).
Lambda expressions will work, although you will see errors in the editor.
As to your plugin, do you want to reference a local plugin in your project's pom.xml

How to patch an eclipse plugin?

I'd like to fix a bug in an eclipse plugin (an official plugin of the WTP).
I locally changed the source code, debugged it - everything is fine.
Now I'd like to propagate this change to my eclipse installation, but I am facing problems.
There seems to be more than one way to achieve this, e.g.:
This site recommended fragments, but the Eclipse FAQ disadvises that.
But I am stuck and no way seems to work for me.
UPDATE:
I tried to create and install a feature patch, as suggested.
After this installation the feature patch is installed, but not the containing patched plugin.
The previous/existing version of the plugin is still present and active.
I'd like to know why this is the case?
Does this something have to do with signing of the official plugins?
Is there a log to see why the patched plugin has not been installed?
FINAL UPDATE:
The problem was that I patched a parent feature (which has been shown in the eclipse installation details), not the direct feature which directly contained the plugin.
After specifying the correct/"lowest-level" feature for patching, everything worked as expected.
The best approach is to create what's known as a "feature patch". A feature patch consists of the entire new version of the plugin you are patching along with a feature that describes what's being patched. See this useful blog post:
http://aniefer.blogspot.com/2009/06/patching-features-with-p2.html

how to compile code from svn into jar file?

I found HTMLUnit is useful for me,but the files are too old.
So I use svn co https://htmlunit.svn.sourceforge.net/svnroot/htmlunit htmlunit to check the code,But I don't know how to use them.
Is there somebody can tell me how to compile them?
I see you have very little knowledge of Subversion.
I could link you to lots of verbose documentation, but let's make it quick and easy: what you downloaded is the whole repository, containing lots of redundant code, majorly the three canonical directories branches tags trunk.
In order to obtain usable code, you either download a stable (tag) version or unstable version (trunk). Advantage of trunk over tag is that it mostly contains new features, but tags are generally stable.
Try to get the following URL: https://htmlunit.svn.sourceforge.net/svnroot/htmlunit/tags/HtmlUnit-2.8/, then you could try ant to build (I'm no Java expert, does the package have an ant script?)
You don't need to take the detour of building it from sources yourself. The latest version is 2.8, and it's readily available from the Maven central repository. If you're not using a dependency manager, just grab the jar from here:
http://repo2.maven.org/maven2/net/sourceforge/htmlunit/htmlunit/2.8/
Check out the projects instructions on how to get and build the latest version !
http://htmlunit.sourceforge.net/gettingLatestCode.html.
It seems it ships as a collection of submodules, each with its own build system (some of them maven, some ant).
The latest release dates back to August 2010, doesn't seem to be that old, but if you're aware of improvements you need which are available only in later versions I suggest you look at their CI server, which provides already the artifacts from the latest build.

Categories