Setting the javapath class (for super-dev mode)

I am trying to run jar, gwt-codeserver.jar , on OSX.7 using the command

 java -cp ".:/sdk/gwt-2.5.0.rc1/gwt-dev.jar" -jar /sdk/gwt-2.5.0.rc1/gwt-codeserver.jar com.activegrade.TeacherView 

Team Failure:

 Exception in thread "main" java.lang.NoClassDefFoundError: com/google/gwt/core/ext/TreeLogger Caused by: java.lang.ClassNotFoundException: com.google.gwt.core.ext.TreeLogger at java.net.URLClassLoader$1.run(URLClassLoader.java:202) ... 

But gwt-dev.jar contains a definition for com.google.gwt.core.ext.TreeLogger, so I came to the conclusion that I am not setting the classpath correctly.

Am I setting the classpath correctly? The jar file is definitely the right jar, and it is definitely in that place. How can I diagnose this further?

+6
source share
6 answers

Could this be the source of your problem? "When you use the -jar parameter, the JAR file is the source of all user classes, and other parameters of the user class path are ignored."

+2
source

I have a CodeServer working as an external tool in Eclipse (caveat - you still need to somehow upload your html file, which I have not done yet, but it looks like it works with codes). To configure CodeServer as an external tool in Eclipse,

0) Remember that you must also update the module.gwt.xml file to enable the use of Super Dev Mode markers and enable source maps for debugging. Add these simpals to the module.gwt.xml file.

 <!-- enable the SuperDevMode book marklets --> <add-linker name="xsiframe"/> <set-configuration-property name="devModeRedirectEnabled" value="true"/> <!-- enable source maps --> <set-property name="compiler.useSourceMaps" value="true" /> 

1) Open the dialog "External tools / external tools"; it is under the top level of the Run menu in Windows.

2) Create a new configuration by selecting “Program” in the list on the left, then click the “Create” button (this looks like a document). Name your configuration in the dialog box.

3) The path to the java.exe file is in the "Location" field. You can use the Browse File System button to find it if you don’t know the path.

4) I left the working directory empty. I'm not sure if that matters; he works without him. Does anyone know for sure if this needs to be installed?

5) The main part of the work is in the "Arguments:" field. You will provide an argument for the class path, which will include the path to gwt-dev.jar, gwt.user.jar, gwt-codeserver.jar and the source directory. Then you provide -jar and an argument for gwt-codeserver.jar and the CodeServer class to run, then you provide the CodeServer arguments. I will break it;

5a) -cp "a comma-separated list of class paths surrounded by double quotes." To make your tool definition more portable, use eclipse "Varaibles" to calculate the paths related to your installation. In particular, I used "workspace_loc" for relative workspace paths (for example, the src directory) and "eclipse_home" for gwt SDK paths such as gwt-user.jar (because I installed the SDK in the eclipse plugins folder). Here is my part of the classpath;

 -cp "${eclipse_home}plugins\gwt-2.5.0.rc1\gwt-2.5.0.rc1\gwt-user.jar;${eclipse_home}plugins\gwt-2.5.0.rc1\gwt-2.5.0.rc1\gwt-dev.jar;${workspace_loc:\GWTFractionTest\war\WEB-INF\lib\gwtquery-1.1.0.jar};${eclipse_home}plugins\gwt-2.5.0.rc1\gwt-2.5.0.rc1\gwt-codeserver.jar" 

5b) The following is the name of the class that java.exe should run. This is the CodeServer class;

 com.google.gwt.dev.codeserver.CodeServer 

5c) The following are CodeServer arguments. The first is the path to src directly. For me, this is a relative path to the workspace;

 -src "${workspace_loc:\GWTFractionTest\src}" 

5d) Finally, the path to the module (the class path to your gwt.xml file) Here is mine;

 com.conceptua.fractiontest.FractionTest 

Here is my complete list of arguments;

 -cp "${eclipse_home}plugins\gwt-2.5.0.rc1\gwt-2.5.0.rc1\gwt-user.jar;${eclipse_home}plugins\gwt-2.5.0.rc1\gwt-2.5.0.rc1\gwt-dev.jar;${workspace_loc:\GWTFractionTest\war\WEB-INF\lib\gwtquery-1.1.0.jar};${eclipse_home}plugins\gwt-2.5.0.rc1\gwt-2.5.0.rc1\gwt-codeserver.jar" com.google.gwt.dev.codeserver.CodeServer -src "${workspace_loc:\GWTFractionTest\src}" com.conceptua.fractiontest.FractionTest 

6) Select the "Run" button to start CodeServer. When I do this on the console,

 workDir: C:\Users\Ezward\AppData\Local\Temp\gwt-codeserver-6942784883227417581.tmp binding: user.agent=safari binding: compiler.useSourceMaps=true binding: locale=en Compiling module com.conceptua.fractiontest.FractionTest Validating units: Ignored 72 units with compilation errors in first pass. Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors. Computing all possible rebind results for 'com.google.gwt.useragent.client.UserAgentAsserter' Rebinding com.google.gwt.useragent.client.UserAgentAsserter Checking rule <generate-with class='com.google.gwt.editor.rebind.SimpleBeanEditorDriverGenerator'/> [WARN] Detected warnings related to 'com.google.gwt.editor.client.SimpleBeanEditorDriver'. Are validation-api-<version>.jar and validation-api-<version>-sources.jar on the classpath? Specify -logLevel DEBUG to see all errors. [WARN] Unknown type 'com.google.gwt.editor.client.SimpleBeanEditorDriver' specified in deferred binding rule Compiling 1 permutation Compiling permutation 0... Source Maps Enabled Compile of permutations succeeded Linking into C:\Users\Ezward\AppData\Local\Temp\gwt-codeserver-6942784883227417581.tmp\com.conceptua.fractiontest.FractionTest\compile-1\war\fractiontest; Writing extras to C:\Users\Ezward\AppData\Local\Temp\gwt-codeserver-6942784883227417581.tmp\com.conceptua.fractiontest.FractionTest\compile-1\extras\fractiontest Link succeeded Compilation succeeded -- 58.257s Compile completed in 60831 ms 2012-07-01 12:37:03.184::INFO: Logging to STDERR via org.mortbay.log.StdErrLog 2012-07-01 12:37:03.185::INFO: jetty-6.1.x The code server is ready. Next, visit: http://localhxst:9876/ 2012-07-01 12:37:03.274::INFO: Started SelectChannelConnector@127.0.0.1 :9876 

I'm not sure why I get the original '72 Units with compilation errors', but it seems to continue to successfully compile and start the server.

7) At this point, you must enter this CodeServer code in Chrome. You will get a page that shows that CodeServer is working, and you can drag book markers to the bookmark toolbar;

 GWT Code Server Drag these two bookmarklets to your browser bookmark bar: Dev Mode On Dev Mode Off Visit a web page that uses one of these modules: fractiontest Click "Dev Mode On" to start development mode. 

8) The next step is to go to your html file to run it. Apparently, it should be served by a separate web server. I am still working on this part.

Ed

+7
source

I spent a lot of time trying to get it to work. I tried to follow Ezwood’s wonderful instructions, but my setup is probably a little different, and it didn’t work for me. There are many moving parts, and any error throws tons of NullPointer, StackOverflow, and UnableToComplete exceptions.

The only set of instructions that worked for me I found at http://blog.daniel-kurka.de/2012/07/mgwt-super-dev-mode.html (Daniel Kurk's blog). Hope this helps someone stuck in GWT Super Dev mode like me.

+2
source

You can use it as below.

 java -cp ".:/sdk/gwt-2.5.0.rc1/gwt-dev.jar:/sdk/gwt-2.5.0.rc1/gwt-codeserver.jar" com.activegrade.TeacherView 
+1
source

There was the same problem. Here is what helped me:

 java -cp "./gwt-codeserver.jar:./gwt-dev.jar" com.google.gwt.dev.codeserver.CodeServer 

You can add -help as such:

 java -cp "./gwt-codeserver.jar:./gwt-dev.jar" com.google.gwt.dev.codeserver.CodeServer --help 

Output:

 CodeServer [-bindAddress address] [-port port] [-workDir dir] [-src dir] [module] where -bindAddress The ip address of the code server. Defaults to 127.0.0.1. -port The port where the code server will run. -workDir The root of the directory tree where the code server willwrite compiler output. If not supplied, a temporary directorywill be used. -src A directory containing GWT source to be prepended to the classpath for compiling. and module The GWT modules that the code server should compile. (Example: com.example.MyApp) 

and then just set the -src directory and your module name

+1
source

I was able to solve this problem by adding gwt-user.jar to the classpath in addition to gwt-dev.jar. In GWT super-mode instructions, you may need to add gwt-user.jar.

+1
source

Source: https://habr.com/ru/post/919342/


All Articles