I am developing an java application that uses a DB for an embedded device (using CDC Foundation 1.1 and jsr 169). the jsr169 jar file should be loaded by the boot strap loader (and not using the traditional -classpath option)
In order to run the application, I am using the following command
cvm -Xbootclasspath/a:/mylibs/jsr169.jar -cp $CLASSPATH -jar myapp.jar
But I read somewhere that the option -Xbootclasspath is not standard, is it dangerous to use it? if yes, where can i put my jsr169.jar so it can loaded directly by the boot class loader?
thanks a million guys
Elie
-Xbootclasspath isn't a standard java option, so JVMs by different vendors may not support it.
Another danger lies in the fact that it can be used to override standard classes from JRE - if your application depends on such overriden classes, you may have problems with running on different JVMs or even newer versions of the same JVM.
According to Java SE documentation, overriding standard classes breaks Java license: according to Oracle documentation,
"Applications that use this option for the purpose of overriding a class in rt.jar should not be deployed as doing so would contravene the Java 2 Runtime Environment binary code license.". I don't see such warning in documentation for CVM, though.
As CDC does not include JDBC classes, I guess you're safe.
Related
I am beginner in apache spark-scala, and I have been created a project with SBT (self-contained application).
I searched on Internet and I asked many people, why we create the self-contained application on scala with SBT ? Why we need for self-contained application ? What is the interest of the self-contained application ?
I arrived to these results:
- we create the self-contained application in scala with sbt to create an arborescence of project and we can run a full program.
- In the running of program we genere a file jar.
I run my program like this:
spark-submit --class "name_file" --master local[*] target/scala-2.11/"name_project"_2.11-1.0.jar
With the self-contained application we can give my file jar to another person and he can running my program without install spark or scala in another machine (like the files .dll in C++).
And finally, may be my question is not normaly, but I told, that I can ask my question in StackoverFlow and I am sure that I'll find the best answer.
Thank you!
Name itself states that it have no external dependencies while running (not developing) it in production environments.
A self-contained application consists of a single, installable bundle
that contains your application and a copy of the JRE or any Runtime
environment needed to run the application. When the application is
installed, it behaves the in the same way as any native application.
Read more from here
And in you case a simple self contained application is here
I face the below error while trying to run http://localhost:7103/dyn/admin/
atg 10.1.2 on windows 7 dyn/admin
The detailed exception is: java.io.IOException:
Cannot run program "javac": CreateProcess error=87,
The parameter is incorrect
this appear because windows has limitation on command parameter lenght
please advice how to solve this issue.
According to the ATG Support site:
Oracle Commerce ATG will convert JHTML pages into Java servlets and
then compile them into class files using the javac Java compiler. By
default, the javac executable is invoked to perform the page
compilation.
These errors point to a low level problem invoking the javac compiler. error=87 is mainly a problem on WebLogic 12 which has many different libraries in deeply nested directories.
The solution (which works for me on ATG11.1 and Weblogic 12.1.3) is
Edit or create the files
<ATG_Home>/localconfig/atg/dynamo/servlet/pagecompile/PageProcessor.properties
<ATG_Home>/localconfig/atg/dynamo/servlet/pagecompile/ExtendedJhtmlPageProcessor.properties
(I prefer to create them in an <ATG_Data>/servers/<servername>/localconfig/... folder but not sure of your setup)
Add these lines to the created above.
# Use java's internal compiler - only use this when using Oracle's JVM.
javaCompilerClassName=atg.servlet.pagecompile.SunJavaSourceCompiler
I am using a .fxbuild-script to build a JavaFX Application. I used Packaging-Format all to include its own runtime. Now I am wondering, how I can define any runtime parameters?
Since we noticed, that we had far more OutOfMemory Issuses within the deployed version than with the local development version, we were monitioring it with Visual VM and noticed, that the embedded JVM (by default?) is only configured to use 256MB of RAM. How can I increase the Maximum available RAM for the included JVM?
The Application is launched by an .exe file after beeing installed on the system.
Update:
The Answer of Roland is correct. I just made the mistake, that I added the <fx:platform>-Tag at the Bottom of the Ant script and not within the appropriate <fx:deploy>-Tag which results in that the <fx:platform>-Tag will be ignored and the JVM is configured to use 256 MB max RAM on 32-Bit and 1/4th of available RAM on 64-Bit.
Please read the Packaging Basics, especially chapter "5.8.2 Customizing JVM Setup".
Excerpt of what you need:
<fx:platform javafx="2.1+">
<fx:jvmarg value="-Xmx400m"/>
...
</fx:platform>
There is java package which I want to import in my powershell script and use the classes available in the package.
Can someone help me achieving this?
PowerShell is based on the .NET runtime. (See the Wikipedia article.) You cannot use Java classes in it. You may, however, use .NET classes. They can be loaded as described here.
Your options are basically:
Find a .NET equivalent. There is often one available, actually.
Write a Java program and execute it using the Java runtime. (java.exe MyClass or whatever command would be used to run it.)
How do YOU debug a Scala program?
I mean YOU as in the person posting the Answer :) Please answer only from personal experience, not from stuff you've heard or read on the Internet. You should not believe everything you read on the Internet, especially tales of complex open-source software configurations that actually work :-)
The are many Java tools which claim to support Scala in some way or another, but I have so far struck out in trying to get any one of them to actually let me set a breakpoint in Scala code and step through it. These are big, major open-source IDEs I'm talking about here.
The main problem in getting a debugger to work seems to be the "version hell" with fast-changing IDEs, Plug-Ins, JDKs, and the Scala language itself.
Hence, the more detailed re-statement of the question is appropriate: What is the exact version number of the IDE, Plug-In, JDK, Scala, and even Operating System, that you are successfully using?
My question is related to this one, but wider in scope:
How To: debug Scala code when outside of an IDE
Thanks
In our development we use IntelliJ IDEA 9.0.1 which is available by the link below:
http://www.jetbrains.com/idea/download/
with Scala plugin installed:
http://confluence.jetbrains.net/display/SCA/Getting+Started+with+IntelliJ+IDEA+Scala+Plugin
All you need is to have project with Scala sources (probably, mixed with Java or other JVM-based languages) opened. You can compile it and run as Java application, maven goal etc. or connect to the remote application if it has been run in debug mode.
See IntelliJ help for details of adjusting debug configuration.
Cheers!
Ilya
I've worked with Eclipse and the Scala plugin for it. It works somewhat ok, if you can overlook the fact that it doesn't remember the configuration for your Scala application on the next run.
I debug my Scala programs by running relevant parts of it on the REPL, as to verify what it is really doing. Other than that, the good old println or logs.
Digressing here a bit, it has been a rare thing in my life a situation where step-in debuggers were actually required -- and, then, mostly for assembler code, though languages where testing snippets of code is difficult for some reason were more likely to require it than others which weren't.
OS: xUbuntu(GNU/Linux) 9.10
JDK:
java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
(which is the Java-6-sun-version, used by the xUbuntu-installer).
Eclipse: 3.5.1 Build id: 20090920-1017
Scala-Plugin 2.7.7final
Scala 2.7.7
If possible: println-Statements, because eclipse is often tricky to invoke (does not find the main class, even after complete rebuild, closing/opening project, deleting old class-Files). The latest search for a problem ended when I 'deleted all bookmarks' - suddenly I was allowed to run the program.
Curious observation: class Bruch was what I tried to run, but eclipse allways mentioned 'Bruc' and named the runtime-configuration like this. Adding and removing characters reflected in the generated name accordingly (Bruc => Bru).